Drupal News

Syndicate content
Drupal related news with the junky stuff filtered out
Updated: 57 min 28 sec ago

3C Web Services: Creating dynamic output on your entity in Drupal 7 using hook_entity_view()

November 25, 2014 - 1:00pm

If you need to create dynamic output on an entity when it is displayed on your Drupal site you have multiple options. One method that is easy to implement is using hook_entity_view().

You can insert this hook function into your custom module (see creating a custom module for more info).

Example:

Mediacurrent: Best Practices for Custom Modules

November 25, 2014 - 11:19am

Recently, I had the need to refer back to a custom module I wrote at a previous job years ago and like it tends to do, the code scared me. As far as I know, this module is still chugging along doing its job to this day, and hasn’t had any issues. But for it to work for us at Mediacurrent, it needed some serious refactoring.

Drupal core announcements: Drupal core updates for November 25, 2014

November 25, 2014 - 10:44am
What's new with Drupal 8?

Drupal 8.0.0 beta3 was released since the last core update, with over 200 fixes after the prior release. There are still over 100 known critical issues, which means more beta releases to come.

We take special care to resolve security and performance issues. Both types of issues may require API changes. There is now defined criteria for performance issues as to what kind of improvements qualify as critical issues (and therefore blocking the Drupal 8.0.0 release).

After 2.5 years of work in part sponsored by MongoDB Inc, led by Károly Négyesi (chx), Drupal 8 can now completely install with MongoDB. This is the first time Drupal in its entirety has been successfully installed in a NoSQL database.


Check out the demo video
.

In almost three weeks, the Drupal Association and Wunderkraut are sponsoring a focused sprint in Ghent to help move core critical issues forward. However, you can help make things move faster anytime from anywhere, so read on!

Where's Drupal 8 at in terms of release?

Since November 8, we've fixed 29 critical issues and 26 major issues, and opened 19 criticals and 40 majors. That puts us overall at 117 release-blocking critical issues and 717 major issues.

How long does it take to fix a critical?

So how long will it take us to fix those critical issues and get to a Drupal 8 release candidate? The average time it takes to fix a critical issue varies enormously depending on the scope of the problem and the resources our contributors can devote to fixing each. Over the course of the Drupal 8 development cycle:

  • 30% of critical issues were fixed within one week of being filed,
  • 50% of criticals were fixed within one month of being filed,
  • 80% of criticals were fixed within six months,
  • and then 20% took more than six months.

This means that one great way to help get Drupal 8 to a release faster is to accelerate some of those long-running issues. Look for the oldest critical issues, or the critical issues that have gone awhile with no updates, and help assess them. Is each still relevant? Is something blocking it? What's the next step that's needed? Is the issue summary up to date? As we both focus on our next milestone and bring these longer-running issues to a successful resolution, we'll be able to narrow our focus to incoming issues and get Drupal 8 done. :)

Current focus

The current top priority in Drupal 8 is to resolve issues that block a beta-to-beta upgrade path (critical issues tagged 'D8 upgrade path'). Supporting an upgrade path between betas is an important step for early adopters to begin building with Drupal 8 (and lending their resources to getting other critical issues done).

We also need core contributors to continue evaluating issues for the beta phase based on the beta changes policy. Note that Dreditor now includes a handy button for inserting a beta evaluation template in issue summaries! Thanks Cottser and Mark Carver for adding this feature so quickly.

Finally, keep an eye out for critical issues that are blocking other work. Add the blocker issue tag that other issues are postponed.

(Note that we're changing this section of the Drupal Core Updates to highlight ongoing goals rather than specific issues, because calls to action in these posts haven't resulted in additional momentum in highlighted issues. Instead, we'll be making brief, separate posts every week or two highlighting top-priority issues in critical areas. If you're a core subsystem maintainer or initiative lead and want to highlight a specific issue, we encourage you to submit your own brief announcement to g.d.o/core (requires access). Anyone in MAINTAINERS.txt is authorized to post to this group!)

How to get involved

If you're new to contributing to core, check out Core contribution mentoring hours. Twice per week, you can log into IRC and helpful Drupal core mentors will get you set up with answers to any of your questions, plus provide some useful issues to work on.

If you'd like to contribute to a particular Drupal 8 initiative or working group, see the regularly scheduled meetings on the Drupal 8 core calendar:

Google Calendar ID:
[email protected]om
XML:
https://www.google.com/calendar/feeds/happypunch.com_eq0e09s0kvcs7v5scdi8f8cm70%40group.calendar.google.com/public/basic
iCal:
https://www.google.com/calendar/ical/happypunch.com_eq0e09s0kvcs7v5scdi8f8cm70%40group.calendar.google.com/public/basic.ics

Note that ultimike is now running a virtual Migrate sprint, Wednesdays 19:00-21:00 EST. See the Migrate in core group page for information and updates.

If you are interested in really digging into a tough problem and helping resolve a stagnating release blocker, or if you are stuck on a critical currently, join the #drupal-contribute IRC channel during weekly critical issue office hours on Fridays at 12:00p PST. See chx's office hours reports for an idea of what we've done so far!

You can also help by sponsoring independent Drupal core development.

Notable Commits
  • Issue 2236855 by rachel_norfolk, stefank, ngocketit, lauriii, LewisNyman, alexpott, yuki77, rteijeiro | mortendk: Use CSS for file icons in file fields.
  • Issue 2364647 by chx, alexpott: Fixed [sechole] Remove blacklist mode from Filter:XSS.
  • Issue 2322509 by prics, cilefen, gaurav.goyal, harijari, Temoor: Replace all instances of node_load(), node_load_multiple(), entity_load('node') and entity_load_multiple('node') with static method calls.
  • Issue 287292 by almaudoh, mr.baileys, drewish, Berdir, znerol, boombatower, dawehner, jpetso, floretan: Add functionality to impersonate a user
  • Issue 2267453 by alexpott, dawehner, damiankloip: Views plugins do not store additional dependencies
  • Issue 2352155 by Wim Leers: Remove HtmlFragment/HtmlPage
  • Issue 2375225 by LewisNyman, davidhernandez: Add emma.maria as Bartik maintainer
  • Issue #2362987 by Wim Leers, Codenator, Pinolo: Remove hook_page_build() and hook_page_alter()
  • Issue #2339151 by EclipseGc, tim.plunkett, Gábor Hojtsy, effulgentsia: Conditions / context system does not allow for multiple configurable contexts, eg. language types
  • Issue #2376791 by dawehner, Wim Leers: Move all _content routing definitions to _controller
  • Issue #2378789 by Wim Leers: Views output cache is broken
  • Issue #2324055 by dawehner, cilefen, znerol: Split up the module manager into runtime information and extension information

You can also always check the Change records for Drupal core for the full list of Drupal 8 API changes from Drupal 7.

Drupal 8 Around the Interwebs Drupal 8 in "Real Life" Whew! That's a wrap!

Do you follow Drupal Planet with devotion, or keep a close eye on the Drupal event calendar, or git pull origin 8.0.x every morning without fail before your coffee? We're looking for more contributors to help compile these posts. You could either take a few hours once every six weeks or so to put together a whole post, or help with one section more regularly. Read more about how you can volunteer to help with these posts!

Drupal Easy: DrupalEasy Career Training Graduates and Growth

November 25, 2014 - 10:25am

Twelve weeks after it began, the first online class of Drupal Career Online (DCO) graduated yesterday, launching six new Drupalists on their way to a new career. With this class, DrupalEasy has now graduated 71 participants from Drupal Career online and in-person programs. Our graduates were taught the fundamentals of Drupal site-building, Git, introductions to module and theme development, site maintenance, distributions, and much more. Along they way, students were required to use the same communication tools as the rest of the community (including IRC), were provided with a community mentor, and were encouraged (pestered?!) to get involved in their local communities.

read more

Open Source Training: Drupal's Basic Cart Module: So Close, But ...

November 25, 2014 - 9:08am

I wasn't sure whether to publish this review or not.

One of our members wanted a really simple shopping cart for Drupal. They found the Basic Cart module and asked me about it.

So, I set up and tested Basic Cart. Everything worked great, until the end when I realized there was no payment gateway. None. Basic Cart is a great little e-commerce store ... except it has no way to pay.

Drupal Watchdog: Load Testing

November 25, 2014 - 8:02am
Feature

Load testing is an important aspect of any project: it provides insight into how your site and infrastructure will react under load. While critical to the launch process of any project, load testing is also useful to integrate into your standard testing procedure. It can help you locate bottlenecks and generic performance regressions introduced in the evolution of a site post launch (due to code and infrastructure changes).

There are many different methodologies and applications for performing load tests, but generally it involves bombarding various pages on the site with enough traffic to start causing degradation. From there, work can be done to isolate bottlenecks in order to improve performance. By performing periodic load tests, you are much more likely to catch something while it’s still a minor performance issue, not after it becomes a major problem.

Different Types of Load Tests

There are a number of different load testing configurations (sometimes referred to as test plans) which can be used individually or in conjunction to provide insight into site performance. Generally, we end up running three different types of tests:

Help Us Plan DrupalCon in India

November 25, 2014 - 7:47am

DrupalCon is an important community event that brings a diverse group of Drupalers together under one roof to share knowledge, grow skills, and strengthen community bonds. As an organization, it is very rewarding to facilitate these experiences around the world.

In the past, our attendance data has shown that DrupalCon is primarily a regional event, attracting attendees from nearby countries and drawing in some great international speakers, trainers, and community leaders. Knowing this, the Drupal Association is committed to hosting DrupalCon in regions other than just North America and Europe.

In 2015, this third DrupalCon is in Bogota, Colombia. In 2016, we want to host DrupalCon in India and this blog explains why. Can you tell us your thoughts on this host country and which city you think should be the next DrupalCon location?

How do you pick locations?

The Drupal Association Board sets the staff’s direction with vision and strategy and they asked staff to come up with a list of possible countries in regions outside of North America and Europe that are viable DrupalCon Locations. They provided us with selection criteria that supported their strategy, which included in no particular order:

  • Popularity - People want to visit the host location to site see.
  • Strong local community: Size of the camp in the proposed city / # of camps in a country
  • Size of Drupal business community - # of Drupal businesses within that country and region
  • Ease of doing business with a country: Easy to set up a financial entity so we can collect ticket sales revenue and pay vendors in local currency.
  • Local Support: The community reached out to the Association, requesting a DrupalCon and offering to help produce it.
  • Inexpensive travel  - This gives insight into the average cost of lodging in the city
  • Visa: Easy to get a visa or one is not required to enter a country.
  • Strong business environment - The number of Fortune 500 companies in that region
  • Community survey: Where does the community want to go?

After researching locations and ranking countries and cities based on the above criteria, several places bubbled to the top. Latin America and specifically Bogota, Colombia was a clear leader, which is why we are hosting DrupalCon 2015 there. India was ranked second over other possible locations.

What makes India a good host country?

India has an impressive number of Drupal leaders, contributors, businesses, and end users. This country drives the 2nd highest amount of traffic to Drupal.org (Unites States had 1M sessions last month, while India had 450,000.) DrupalCon in India can highlight this country’s Drupal strength to the global community while conversely showing the local community how they can contribute more back to the Project.

More specifically, India ranked high because it has several mature camps and many local communities throughout the country. Producing DrupalCon outside of North America and Europe requires a strong partnership with community leaders who can help us with logistics. Plus, a DrupalCon needs power in numbers to make it financially worthwhile and effective, so a large community base is key.

In India, technology conference tickets are usually very inexpensive, so a DrupalCon in India ticket price will need to cost much less than the standard DrupalCon ticket price. Because of the cost of putting on conferences, having low ticket prices means the event will be funded through sponsorships. India has a strong Drupal business community and many are already pledging sponsorship to make the event financially viable.

Which host city is best for you?

We would like to thank Rahul Dewan, Jacob Singh, Mayank Chadha, Rachit Gupta, Ani Gupta, Hussain Abbas, Chakrapani R, Sunit Gala, Venky Goteti, and Shyamala Rajaram and other community leaders for determining the financial feasibility for hosting a 1,000 person DrupalCon in their city. After several discussions, we decided Bangalore, Mumbai, and Delhi are our three most viable host cities. Now we need your input in picking the city where we will host our first DrupalCon in India. Below is a chart summarizing their key findings.

Which city should host DrupalCon and why did you chose that city? (e.g. travel distance, travel cost, ideal hotel cost, preferred venue(s), community size). Please use comments to tell us.

  Bangalore Mumbai Delhi

Venue Recommendation:

(based on 1,000 attendees, 1 keynote room, 6 session rooms, 4 BOF rooms)

  1. Manpho Convention centre
  2. The Lalit Bangalore
  3. NIMHANS Convention centre
    (OSI days happens here)
  1. Grand Hyatt Mumbai
  2. Renaissance Powai 
  3. Films Studios. (under consideration)
  1. The Ashok, New Delhi (more info)
  2. Jaypee Greens Golf & Spa Resort, Greater Noida
  3. Hyatt Regency, Gurgaon

Catering

 

(lunch and coffee/tea break per day)

Rs.500 per person per day
($8) Rs 2,460 - 3,075 per person per day
($40 - $50)
  1. Rs 2,460 per person per day (tax inclusive) ($40)
  2. Rs 2,100 per person per day (tax inclusive) ($35)
  3. Rs 1,400 per person per day (tax inclusive) ($25)
Hotel Room Cost 2KMs from the Venue Manpho

Hotels (3-star)
Rs. 3,500 per night ($57)

Lalit (5-star): Rs.7,500 + tax per night ($121) Grand Hyatt  Rs 9,275 per night ($150)

There are 50+ options around Grand Hyatt for all price points, between Rs 1,545 - 7,420 per night ($25-$120)

Renaissance Powai Rs 11,130 per night ($180)
  1. Rs 8,000 per night ($120) - 2 seater room
    Rs 11,000 per night ($180) - 3 seater room
  2. Rs 9,000 per night ($140) - 2 seater
  3. Rs 8,000 per night ($120) - 2 seater
    Other 3* hotel option (~5km) from the venue - Rs 2,500-4,000 ($40-$80)
Travel to city

From Delhi
By plane - Rs 9,275 RT ($150)

From Bombay
Plane Rs 7,420 ($120)
Bus: (20hr) Rs 3,090 ($50)
Train (20 hr): Rs 3,710 ($60)

From Hyderabad
Mostly Bus and train(overnight journey - 8hrs).
Plane: Rs 7,730 ($125)
Bus: Rs 3,710 ($60)
Train: Rs 3,710 ($60)

From Delhi
Plane (2 hrs) Rs 8,040 ($130)
Train (16 hrs) Rs 4,950 ($80)

From Bangalore
Plane (1hr40) Rs 7,420 ($120)
Train (24 hrs) Rs 3,710 ($60)

From Hyderabad
Plane (1hr10) Rs 5,570 ($90)
Train (10 hrs) Rs 4,330 ($70)

From Bombay
Plane (2hr00): Rs 7,730 ($125)
Train Rs 2,475 ($40)

From Bangalore
Plane (2hr30): Rs 9,275 ($150)

From Hyderabad
Plane (2hr00): Rs 10,820 ($175)

Camps None - Meet Ups, Mini-camps and Trainings Only 500+ attendees 350+ attendees (consistently for past 3 years)

Indian flag image from Wikipedia.

DrupalCamp India image credit to Dries' blog.

Drupal Association News: Help Us Plan DrupalCon in India

November 25, 2014 - 7:47am

DrupalCon is an important community event that brings a diverse group of Drupalers together under one roof to share knowledge, grow skills, and strengthen community bonds. As an organization, it is very rewarding to facilitate these experiences around the world.

In the past, our attendance data has shown that DrupalCon is primarily a regional event, attracting attendees from nearby countries and drawing in some great international speakers, trainers, and community leaders. Knowing this, the Drupal Association is committed to hosting DrupalCon in regions other than just North America and Europe.

In 2015, this third DrupalCon is in Bogota, Colombia. In 2016, we want to host DrupalCon in India and this blog explains why. Can you tell us your thoughts on this host country and which city you think should be the next DrupalCon location?

How do you pick locations?

The Drupal Association Board sets the staff’s direction with vision and strategy and they asked staff to come up with a list of possible countries in regions outside of North America and Europe that are viable DrupalCon Locations. They provided us with selection criteria that supported their strategy, which included in no particular order:

  • Popularity - People want to visit the host location to site see.
  • Strong local community: Size of the camp in the proposed city / # of camps in a country
  • Size of Drupal business community - # of Drupal businesses within that country and region
  • Ease of doing business with a country: Easy to set up a financial entity so we can collect ticket sales revenue and pay vendors in local currency.
  • Local Support: The community reached out to the Association, requesting a DrupalCon and offering to help produce it.
  • Inexpensive travel  - This gives insight into the average cost of lodging in the city
  • Visa: Easy to get a visa or one is not required to enter a country.
  • Strong business environment - The number of Fortune 500 companies in that region
  • Community survey: Where does the community want to go?

After researching locations and ranking countries and cities based on the above criteria, several places bubbled to the top. Latin America and specifically Bogota, Colombia was a clear leader, which is why we are hosting DrupalCon 2015 there. India was ranked second over other possible locations.

What makes India a good host country?

India has an impressive number of Drupal leaders, contributors, businesses, and end users. This country drives the 2nd highest amount of traffic to Drupal.org (Unites States had 1M sessions last month, while India had 450,000.) DrupalCon in India can highlight this country’s Drupal strength to the global community while conversely showing the local community how they can contribute more back to the Project.

More specifically, India ranked high because it has several mature camps and many local communities throughout the country. Producing DrupalCon outside of North America and Europe requires a strong partnership with community leaders who can help us with logistics. Plus, a DrupalCon needs power in numbers to make it financially worthwhile and effective, so a large community base is key.

In India, technology conference tickets are usually very inexpensive, so a DrupalCon in India ticket price will need to cost much less than the standard DrupalCon ticket price. Because of the cost of putting on conferences, having low ticket prices means the event will be funded through sponsorships. India has a strong Drupal business community and many are already pledging sponsorship to make the event financially viable.

Which host city is best for you?

We would like to thank Rahul Dewan, Jacob Singh, Mayank Chadha, Rachit Gupta, Ani Gupta, Hussain Abbas, Chakrapani R, Sunit Gala, Venky Goteti, and Shyamala Ramajan and other community leaders for determining the financial feasibility for hosting a 1,000 person DrupalCon in their city. After several discussions, we decided Bangalore, Mumbai, and Delhi are our three most viable host cities. Now we need your input in picking the city where we will host our first DrupalCon in India. Below is a chart summarizing their key findings.

Which city should host DrupalCon and why did you chose that city? (e.g. travel distance, travel cost, ideal hotel cost, preferred venue(s), community size). Please use comments to tell us.

  Bangalore Mumbai Delhi

Venue Recommendation:

(based on 1,000 attendees, 1 keynote room, 6 session rooms, 4 BOF rooms)

  1. Manpho Convention centre
  2. The Lalit Bangalore
  3. NIMHANS Convention centre
    (OSI days happens here)
  1. Grand Hyatt Mumbai
  2. Renaissance Powai 
  3. Films Studios. (under consideration)
  1. The Ashok, New Delhi (more info)
  2. Jaypee Greens Golf & Spa Resort, Greater Noida
  3. Hyatt Regency, Gurgaon

Catering

 

(lunch and coffee/tea break per day)

Rs.500 per person per day
($8) Rs 2,460 - 3,075 per person per day
($40 - $50)
  1. Rs 2,460 per person per day (tax inclusive) ($40)
  2. Rs 2,100 per person per day (tax inclusive) ($35)
  3. Rs 1,400 per person per day (tax inclusive) ($25)
Hotel Room Cost 2KMs from the Venue Manpho

Hotels (3-star)
Rs. 3,500 per night ($57)

Lalit (5-star): Rs.7,500 + tax per night ($121) Grand Hyatt  Rs 9,275 per night ($150)

There are 50+ options around Grand Hyatt for all price points, between Rs 1,545 - 7,420 per night ($25-$120)

Renaissance Powai Rs 11,130 per night ($180)
  1. Rs 8,000 per night ($120) - 2 seater room
    Rs 11,000 per night ($180) - 3 seater room
  2. Rs 9,000 per night ($140) - 2 seater
  3. Rs 8,000 per night ($120) - 2 seater
    Other 3* hotel option (~5km) from the venue - Rs 2,500-4,000 ($40-$80)
Travel to city

From Delhi
By plane - Rs 9,275 RT ($150)

From Bombay
Plane Rs 7,420 ($120)
Bus: (20hr) Rs 3,090 ($50)
Train (20 hr): Rs 3,710 ($60)

From Hyderabad
Mostly Bus and train(overnight journey - 8hrs).
Plane: Rs 7,730 ($125)
Bus: Rs 3,710 ($60)
Train: Rs 3,710 ($60)

From Delhi
Plane (2 hrs) Rs 8,040 ($130)
Train (16 hrs) Rs 4,950 ($80)

From Bangalore
Plane (1hr40) Rs 7,420 ($120)
Train (24 hrs) Rs 3,710 ($60)

From Hyderabad
Plane (1hr10) Rs 5,570 ($90)
Train (10 hrs) Rs 4,330 ($70)

From Bombay
Plane (2hr00): Rs 7,730 ($125)
Train Rs 2,475 ($40)

From Bangalore
Plane (2hr30): Rs 9,275 ($150)

From Hyderabad
Plane (2hr00): Rs 10,820 ($175)

Camps None - Meet Ups, Mini-camps and Trainings Only 500+ attendees 350+ attendees (consistently for past 3 years)

Indian flag image credit to Sanyam Bagha on Flickr.

DrupalCamp India image credit to Dries' blog.

InternetDevels: InternetDevels is among the best Drupal developers worldwide

November 25, 2014 - 7:23am

Everyone is happy to get a sign of appreciation, right? So were we having received a message from the American ranking service Clutch.co, which is regularly analyzing the market worldwide to make up lists of the best companies in certain spheres. Not so long ago they published a new list, based on fresh-conducted research. And know what? InternetDevels company was included in those new list!

Read more

Code Enigma: Twitter Pane

November 25, 2014 - 6:54am
Almost certainly, a time will come when a client asks for a list of Tweets to be displayed on their Drupal site.

Dries Buytaert: The power of self-managed teams in Drupal

November 25, 2014 - 6:49am
Topic: DrupalLeadership

The concept of official initiatives came out of lessons learned from the Drupal 7 development. We learned a lot from that and in a recent blog post about Drupal initiative leads, I recognized that we need to evolve our tools, our processes, and our organizational design. Others like Nathaniel Catchpole, Larry Garfield and Gábor Hojtsy have shared some of their thoughts already. One of the things I'm most proud of is that the Drupal community is always looking to improve and reinvent itself. Evolving is an important part of our culture. Each time it will get better, but still won't be perfect.

For me, one of the biggest take-aways (but not the only one) is that for an initiative to succeed, it needs to be supported by a team. An initiative needs to carry out a technical vision, plan the work, communicate with all stakeholders, mobilize volunteers, raise funding, organize sprints, and more. It can easily be more than one person can handle -- especially if it isn't your full-time job or if your initiative is complex.

More specifically, we have learned that the most successful initiatives appear to be run by teams that are self-managed; the team members collaborate in the development of the initiative, but also share both managerial and operational responsibilities like planning, coordinating, communicating, sprint organizing and more.

Because self-managed teams are both responsible for their outcomes and in control of their decision-making process, members of a self-managing team are usually more motivated than traditional hierarchical teams. This independence and greater responsibility are important in volunteer communities. Self-managed teams also build and maintain institutional knowledge. The outcome of their work is also more easily accepted by other stakeholders (like core committers) because they have already built a lot of consensus.

If I were to be an initiative lead, I'd feel strongly about building my own team rather than being handed a team. My initial assumption was that each initiative lead would build his/her own team. In hindsight, that was a mistake. Team building is not easy. It requires a time investment that can seem to compete with technical priorities. This is an important lesson and something we can do better going forward. Before making an initiative official, we have to make sure that each initiative has a good team and the support to be successful -- either we can help create a team, provide more coaching or formal training around team building, or we shouldn't designate the initiative official until such a team has coalesced.

Code Enigma: Let's Get Views In Core

November 25, 2014 - 6:47am
Code Enigma are sponsoring a Views In Core sprint in Paris, France, from 26th - 28th August 2012.

Shomeya: Failure to Launch: The Myth of the Missing Map

November 24, 2014 - 4:00pm

It's all about perspective when it comes to launching. We always think we need something more, that missing set of instructions or special ingredient that will propel us to finish. That special person, few moments of sanity, or foolproof plan.

But at the end of the day, while those things may encourage us to make the choice to take action or bring balance and clarity, they never change the fact that we won't make it anywhere until we start the journey. We could be waiting at the bus stop thinking it's the only way we'll get there, when the whole time we could have been on the train.

Read more

Visitors Voice: Turn the negative trend regarding site search

November 24, 2014 - 1:10pm
Almost every second user (45%) are dissatisfied or very dissatisfied, having a hard time finding information they are looking for according to a survey (2014). The survey also shows that it is getting worse due to rapid information growth and users’ tendency to increase expectations. The better web search engines like Google gets, the higher […]

Wizzlern: Drupal 8 Configuration Management with Drush

November 24, 2014 - 11:45am

Today I got my feed wet with Drupal 8 Configuration Management. For those who are new to this excellent feature in Drupal 8, you should read the documentation at drupal.org (Managing configuration in Drupal 8) or watch this DrupalCon Amsterdam video. This article assumes you are familiar with Drush and Drush aliases.

I worked with a very basic workflow using a development site and an acceptance site. Both sites are under revision control, where the complete webroot (core + modules, but not settings.php) is placed in git. For gitignore I used a copy of the example.gitignore which you'll find in Drupal's root directory.

I used Drush 7 to import and export the configuration. 'Export' is to transfer a site's configuration from Drupal to file and 'Import' is to transfer in reversed direction. Using drush @dev config-export you export the configuration from the development site to the sites/default/config_*/staging directory. The staging directory now holds many *.yml files that each contain the configuration of an individual section. I've chosen to use git to transfer these files to the acceptance site. At the acceptance site drush @acc config-import is used to transfer the configuration from the file system to the acceptance site.

Make sure that the acceptance site is a copy of the development site. For example using drush @dev archive-dump you can make a copy of both the files and database. With this you can create a copy of the site using drush archive-restore.

I made these changes to the .gitignore file to allow the staging directory to be added to git:

Tags: drupal 8drushdeploymentconfiguration management

Forum One to work on Content Strategy for Drupal.org

November 24, 2014 - 10:38am

Several weeks ago, we issued an RFP for Drupal.org Content Strategy project. We got a number of great submissions, and the next couple of weeks the Drupal Association staff and the Drupal.org Content Working Group members spent reviewing proposals and interviewing potential vendors.

Today we are happy to announce that we’ve selected a vendor for the content strategy project: Forum One, an open-source digital agency.

Their proposal met all our project requirements and outlined a solid plan for how we can make this project happen. During the interviews Forum One impressed us with their professionalism, passion for content strategy, their extensive experience working on large content strategy projects, and their deep knowledge of the Drupal community and Drupal.org, the website.

We believe that together our staff and Forum One team will make this project a success. Can’t wait to start working and improve Drupal.org content for all our varied audiences.

Drupal Association News: Forum One to work on Content Strategy for Drupal.org

November 24, 2014 - 10:38am

Several weeks ago, we issued an RFP for Drupal.org Content Strategy project. We got a number of great submissions, and the next couple of weeks the Drupal Association staff and the Drupal.org Content Working Group members spent reviewing proposals and interviewing potential vendors.

Today we are happy to announce that we’ve selected a vendor for the content strategy project: Forum One, an open-source digital agency.

Their proposal met all our project requirements and outlined a solid plan for how we can make this project happen. During the interviews Forum One impressed us with their professionalism, passion for content strategy, their extensive experience working on large content strategy projects, and their deep knowledge of the Drupal community and Drupal.org, the website.

We believe that together our staff and Forum One team will make this project a success. Can’t wait to start working and improve Drupal.org content for all our varied audiences.

Phase2: Drushful Thinking

November 24, 2014 - 10:00am
What is Drush?

If you’re asking that question right now then congratulations! You are one of the lucky people who will have your life changed today! Cancel everything and read up on Drush, the command line bridge to Drupal.

Everybody knows about Drush, ya Dingus!

That’s more like it. Who doesn’t love Drush, right? Right!

But more and more, I find myself seeing people reinventing things that Drush already handles because they just don’t know all that Drush can do. It’s getting frustrating, and I want to fix that.

First, The Basics Stuff everybody knows

Here are a few Drush commands that most people know and love, just to get them out of the way:

  • drush updb: run pending database updates
  • drush cc all: clear all caches
  • drush dl <something>: download the <something> module
  • drush en <something>: enable the <something> module
Stuff everybody knows (Features Edition)

And if you’re using Features, you’re probably familiar with:

  • drush fra: revert all Features
  • drush fe: export a new or updated Feature with a new component
  • drush fu <featurename>: update the <featurename> Feature with updated site config
  • drush fr <featurename>: revert the site’s config to the current state of the <featurename> Feature
Aliases

For a lot of the fun stuff, you’ll have to understand Drush aliases. If you don’t, here’s the gist: Drush aliases give you an easy way to run Drush commands on remote Drupal sites, as opposed to only being able to use it on your local sites. If you’re constantly SSH’ing into different environments just to run a couple quick commands, you need to stop doing that.

There’s lots of documentation about Drush aliases and how to create your own, but most of the docs lack notes on some of the lesser known awesome things you can do with aliases. Keep reading, sailor.

Well, one more thing. This is probably a good time to mention a couple quick commands.

Firstly, let’s run an arbitrary shell command on our dev environment.

drush @foo-dev exec echo $SOMETHING

Or maybe we should just go ahead and SSH in to do something a little more complex.

drush @foo-dev ssh

Or maybe we need to do a bunch of aliased commands, but we want to do it without SSH’ing in (because the commands require local files or something). We can make a Drush alias persist until we tell it to stop using:

drush site-set @foo-dev

And then when we’re done doing what we do, we can just run it again without the “@foo-dev” argument to unset it.

Now, keep reading, sailor.

Syncing Ship

(Warning: these headlines are going to get worse and worse)

One of the most common things to do with Drush aliases is to sync stuff from one alias to another.

For example, want to sync the dev site database down into your local?

drush sql-sync @foo-dev @foo-local

How about files? Sync ‘em!

drush rsync @nexderm-dev:%files @nexderm:%files

Or maybe some unwashed sent you a DB dump and you have to import it the old fashioned way?

cat ~/path/to/file.sql | drush sql-cli

Sometimes you want to drop your entire database before importing, to make sure you don’t get any tables left behind from your old install that aren’t supposed to be there. That’s as easy as:

drush sql-drop

Sometimes, it’s useful to be able to automate running arbitrary SQL commands on multiple environments, and that’s pretty easy too. Say for example that you quickly want to get the username for uid 1 on the prod environment (the “drush user-information” command would be much better for this, but shut up).

drush @foo-prod sqlq 'select name from users where uid = 1'

That one is also good for automation, like if you want to write a quick script that changes the username for uid 1 on all environments.

Drupal Without Drupal

It’s often useful to run one-off arbitrary code within the context of Drupal, without having to actually put it in the codebase somewhere. This is typically done one of two ways:

If it’s just a short one-liner, then there’s the ever-useful “php-eval” (aka “ev”) command. For example, let’s inspect a node object.

drush @foo-dev php-eval 'print_r(node_load(123));'

Or if it’s a longer one, then we can just throw our code into a PHP file, and run it using:

drush php-script filename.php

Reports Cohorts

Drush is really good at getting us information from Drupal without waiting for a full page load.

How many times have you navigated to the Watchdog page and sat through page load after page load while you went through the pagination and added filtering and blah blah blah to find an error message? Stop doing that! Do this instead:

drush watchdog-show

There are a lot of useful options for watchdog-show, such as:

  • –tail (continuously show new messages)
  • –full (show the full output, with all of the fields, instead of the summarized version)
  • –severity (such as “–severity=error”)
  • –count (show more than the default 10, such as “–count=100″)

And I’d bet you’re familiar with “drush vget” to get variables, but did you know you can pass “–format=whatever” to get the results formatted as JSON or CSV or YAML or a bunch of other things, for easy scripting?

Another one of my favorites is this charm, which basically prints out the stuff you see on the Status Report page in Drupal. It’s nice for sanity checking before pushing releases live.

drush status-report

And then there’s this guy, which prints out a bunch of useful info about the current installation, such as DB info, path to PHP executable and .ini file, Drupal version, Drupal root, etc. It’s a nice first step when debugging a broken install.

drush status

And for those times when you need to edit a config file (php.ini, or settings.php, or an alias file, or .htaccess, etc.), you can run this to let you choose which of those files to edit and it’ll open it up in an editor for you:

drush config

Using Users

Drush is nothing short of a miracle when it comes to user management.

First of all, there’s the ever-annoying task of logging in as this user or that user. You usually don’t know the password, or maybe you’re just too lazy to type it. Run this to open up your browser with a one-time login link so you can skip all of that malarky:

drush user-login name-or-uid

Or, if you’re slightly less lazy, and just want to change the password to something so that you can log in the old fashioned way:

drush user-password name-or-uid --password=test1234

Then there’s the “fun” process of adding a user and filling out the form. Skip that:

drush user-create person123 --mail="[email protected]" --password="letmein"

Once that’s done, you probably want to give that new user some roles. For role stuff, you have this:

drush user-add-role "user editor" person123 drush user-remove-role "user editor" person123

But watch out! The role you need to add doesn’t exist yet! Let’s add it, and give it some permissions.

drush role-create 'user editor' drush role-add-perm 'user editor' 'administer users'

If you just need to show information about a user, such as email address, roles, UID, etc., try this. I’m embarrassed to say that I’ve been using raw SQL for this for years.

drush user-information name-or-uid

Fields of Dreams

One of the most under-used things that Drush gives you is field management tools. I’m going to be lame here and just copy and paste the docs, since they’re pretty self explanatory.

Field commands: (field) field-clone Clone a field and all its instances. field-create Create fields and instances. Returns urls for field editing. field-delete Delete a field and its instances. field-info View information about fields, field_types, and widgets. field-update Return URL for field editing web page.

Other Schtuff

Here are some great commands that don’t really fit into any clear-cut categories.

It has some neat archiving tools:

drush archive-dump #backup code, files, an DB to a single package drush archive-restore #expand one of those archives into a full Drupal site

Somewhat similar to those is this one, which will download and install Drupal, serve it using a little built-in server, and log you in, all in one command. Note that this one includes about a bazillion options and is super duper powerful.

drush core-quick-drupal

Drush also lets you play with the cache, which can save a lot of time when debugging a caching issue:

drush cache-get your-cid your-bin drush cache-set your-cid your-data your-bin your-expire

There are a couple unknown commands for working with contrib:

drush pm-info modulename #display included files, permissions, configure link, version, dependencies, etc. drush pm-releasenotes modulename #show the release notes for the version of module that you're using

Run cron! Not exciting, but super useful.

drush cron

Have you ever been in the middle of debugging and you know that something is happening in a form_alter (or some other hook) but you’re not sure in which module? Try this command, which will tell you all of the implementations of a given hook, and let you choose one to view the source code of it.

drush fn-hook form_alter

And finally, this bad boy is basically “Drush docs in a box” and has a TON of useful info. Seriously, try it now.

drush topic

Drushful Thinking

There’s a giant heap of useful Drush commands, some of which you hopefully hadn’t seen before. So what, right?

The “so what” is that it’s useful to start thinking in terms of “how can Drush do this for me?” and you’ll often find that the answer is “pretty easily.”

Play a game with yourself. Next time you’re working on site building or anything that involves a lot of clicky clicky in the Drupal UI, give yourself a jellybean or a chip or something every time you do something in Drush instead of in the UI.

But why? Well for one, before you know it, you’ll be spending  much less time waiting on page loads. But secondly, Drush lends itself to automation, and thinking in terms of Drush naturally leads you to think in terms of automating and scripting things, which is a great place to be.

Practice some Drushful Thinking! And let me know any of your favorite Drush tips and tricks in the comments. Check out drushcommands.com for some more inspiration.

3C Web Services: Essential Drupal 7 Modules

November 24, 2014 - 7:01am

INTRODUCTION

Drupal is a great CMS but really isn't very powerful out of the box. To harness its power you'll need to use contrib (contributed) modules. Contributed modules are created by the community and are not part of the core Drupal download. But they can be downloaded and installed from the drupal.org website.