Skip to Content

Planet Drupal

Syndicate content - aggregated feeds in category Planet Drupal
Updated: 1 day 15 hours ago

OSTraining: How to Install Drupal 8

17 November 2015 - 9:33pm

Drupal 8 is set to be released this week and it promises to be the best version of Drupal yet.

In these two videos, Rod will show you how to install Drupal 8 at your host or on your computer.

Categories: Drupal

KnackForge: Drupal 8 Release Party in Chennai

17 November 2015 - 8:00pm

Drupal 8, a collective work of 3.3k contributors from 90+ countries, after more than a couple of years of development with more than 200 new features and improvements finally reaching a milestone and limelight. Tentatively 1232 companies have supported its development.

For Drupal specialized companies like KnackForge this is a momentous occasion. We are feeling excited about the release of Drupal 8. KnackForge is proud to join hands with Drupal Chennai Group and other Drupal shops in Chennai along with other Drupal groups around the world in hosting a release party on Thursday, November 19th, 2015!

We celebrate the party in honor to appreciate the great efforts of thousands of contributors all over the world! Let’s do it together!

Please sign up at Event posted on Grab your Drupal 8 T-shirt for free. Limited offer only, please RSVP sooner.

Categories: Drupal

OSTraining: New Video Class: Managing Multiple WordPress Sites With ManageWP

17 November 2015 - 3:56pm

This week's new video class is "Managing Multiple WordPress Sites With ManageWP".

Managing multiple WordPress sites can be a challenge. There are always updates, comments and more to deal with. ManageWP is a great solution.

In this class, Topher takes you through the basics that you get for free and shows the benefits of easy site maintenance that ManageWP brings to your workflow.

Categories: Drupal

Fabian Franz: Why Drupal 8 is defaulting its testing to PHP7 and why you should, too

17 November 2015 - 1:32pm

Drupal 8 the newest version of the Drupal content management system is around the corner and will be released Nov 19. PHP7 - the newest generation of the PHP language powering Drupal - will be released later in 2015.

PHP7 features lots of new things, but the most significant part is a 20-50% speed increase, which comes from the completely rebuilt Zend engine VM that powers PHP under-the-hood.

The new code is not only easier to understand, but also cleaner, faster and doing much less memory copying.

However as with all bleeding-edge software there are bugs and sometimes those bugs can be so tricky that during normal development they do not occur. In fact the bugs Drupal 8 found pushed the release date of PHP 7 back - - but more to that later in this post. So when should you switch?

Drupal 8 already early on had a plan to support PHP7 out of the box with Drupal 8. (

During that effort by several Drupal 8 contributors, bugs and segfaults have been reported to the PHP team ( and also incompatibilities have been resolved in the Drupal 8 and Symfony 2 code bases.

For example Null, False, True, which had been classes in Symfony 2, are now reserved keywords. Or Drupal 8 used the String namespace, which also now is reserved. Also Drupal 8 had been relying on uasort behavior being deterministic (which it is not) - though some cases still remain:

In the end Drupal 8's test suite did almost pass on PHP7, but there were some remaining test failures. Drupal’s tests run on DrupalCI, which is hosted and fully integrated into itself, supporting PHP 5.3-7, MySQL, sqlite and PostgreSQL for both Drupal 7 and Drupal 8 core and contrib modules. As the core maintainers wanted Drupal 8 to ship with full PHP7 support and no known bugs and, because PHP7 stable release was one week before Drupal 8's release now was the last chance to fix that. So the issue became critical again.

With the help of a 10 hour Drupal 8 Accelerate grant (thank you very much Drupal Association), neclimdul, me (Fabianx) and alexpott embarked  on a journey to track down and fix the remaining really really tricky test failures. (, and

They succeed after close collaboration with the PHP internals team with me (Fabianx) providing the core developers with an EC2 instance, where the bug was easily reproducible and such the PHP internals team finally tracked down the bug in the garbage collector. I reported another bug with a script to reproduce ("array_merge_recursive corrupts memory of unset items") and it was fixed within 3-5 hours after posting the bug report(!).

And such PHP7 became green on Drupal CI on Oct 30, 2015 (

Now with it being green an incentive was started to make PHP7 the default test environment (

This incentive lead to also testing Postgres and SQLite (and those environments are now available for testing) and while SQLlite passed (yeah), postgres failed with several strange bugs.

I followed up again with the PHP team, created two bug reports (, and a pull request (, which solved many of the issues and led to overall more stable PHP7 code base as it was a weird edge case (again!).

One issue is as of this time still remaining with postgres (, but I am pretty sure that the awesome PHP team will track this one down, too. (Even though Drupal CI passes now, it still fails on my test machine.)

However as we still branch test Postgres with PHP 5.5 daily and that is stable, this will only affect a minority of the users and does not affect our ability to switch to PHP7 for general patch testing (with MySQL 5.5). As of now Drupal 8 has 100% test passes with PHP 7 and MySQL, PostgreSQL and SQlite (

Switching to PHP7 for patch testing will allow to reduce patch test time by around 30% (from 30 min to 21 min) and it will allow us to find potential regressions early. This should reduce the costs of the testing infrastructure to the Drupal Association significantly.

Lessons learned
  • Drupal 8 and PHP7 is an open-source community collaboration success story with close collaboration of PHP with Drupal 8 and Drupal 8 with Symfony.

  • Drupal 8 was able to find many many strange bugs with its very extensive test suite and being a complex application itself. That made PHP7 more stable for everyone, as well as finding Symfony/PHP7 incompatibilities earlier than they might otherwise have been discovered

  • Being able to run Drupal 8 on PHP7 directly and know that it will work is a huge benefit to Drupal 8 itself. In fact I also switched over my own Drupal 8 development environment now to PHP7, which means I can test my code faster.

  • Running and switching your test suite to PHP7 not only will give you confidence that your application is well supported on the newest PHP version, but it will also give you beneficial speed improvements.

  • All of this means that Drupal 8 and PHP 7 will be viable for production more or less as soon as they reach stable releases, so that real sites can take advantage of the ~30% performance improvement relative to PHP 5.6.

Tags: drupaldrupal planetphp7
Categories: Drupal

Midwestern Mac, LLC: Celebrate Drupal 8 in St. Louis, MO on Nov 19 - Food, Drinks, and a Raspberry Pi!

17 November 2015 - 1:14pm

On November 19, the St. Louis Drupal Users Group is having a party to celebrate the release of Drupal 8, which has been 4 years in the making! The party will be hosted at Spry Digital in downtown St. Louis, and will have beer provided by Manifest, food and drinks provided by Spry, and a Raspberry Pi 2 model B giveaway sponsored by Midwestern Mac!

Drupal 8.0.0 has been built by over 3,000 contributors in all corners of the globe, and will help kick off the next generation of personalized, content-driven websites. During the meetup, we'll build a brand new Drupal 8 site on the Raspberry Pi using Jeff Geerling's Drupal Pi project, and we'll highlight some of the awesome new features of Drupal 8.

After we build one of the first Drupal 8 sites, we'll give away the Raspberry Pi to a lucky winner to take home and tinker with! Special thanks to the Austin Drupal Users Group, who came up with the Pi giveaway idea!

We'll also eat, drink and be merry, celebrating the start of a new era of site building with the best version of Drupal yet!

If you'd like to join us, please RSVP on the STLDUG Meetup page: STLDUG Drupal 8.0.0 Release Party.

Categories: Drupal

Advomatic: Infographic: Site Building in Drupal 8

17 November 2015 - 12:17pm

We just launched our first Drupal 8 website for the Northwest Atlantic Marine Alliance (NAMA). During our project retrospective, a few of us brought up how nice it was that so many contrib modules that were part of the D6 site weren’t necessary in Drupal 8 – this was a major factor in making it possible to launch... Read more »

The post Infographic: Site Building in Drupal 8 appeared first on Advomatic.

Categories: Drupal

Promet Source: Using Drupal 8 for Government Websites

17 November 2015 - 11:15am
Categories: Drupal

Acquia Developer Center Blog: govCMS: My Experience So Far

17 November 2015 - 10:43am
Stuart Rowlands

The Australian Government launched govCMS earlier this year, a custom Drupal distribution and hosting service catering to all of the Australian government. The aim is to provide a single solution for unclassified websites using a common codebase and a shared feature set on a scalable and secure infrastructure.

Tags: acquia drupal planet
Categories: Drupal

Stanford Web Services Blog: Drupal 8 - A Festivus for the REST of Us

17 November 2015 - 8:05am

The development team was recently given the opportunity to stand up a Drupal 8 REST server with the intent of improving on our D7 content server, learning what's new with the framework and seeing how our content types would fit into the revised architecture. Having just attended BADcamp at UC Berkeley, we were excited to use Drupal 8 and its new special sauce (yml, composer, console, bigpipe, twig, etc).

Categories: Drupal

Chromatic: Drupal Camp Chattanooga 2015

17 November 2015 - 7:56am

A few weekends ago I was fortunate enough to attend my first Drupal Camp ever. What was even more fortunate for me was that it was located near where I grew up in Chattanooga, TN. I’ve been to several leadership/business conferences in my life, but this is the first one that I’ve been to where it felt like everyone was genuinely glad to be there, even on a rainy fall day. In the spirit of open source, it wouldn’t feel right to keep all of the helpful info I learned to myself, so I wanted to take a moment and share some of my key take-aways.

Selling Drupal

Bob Snodgrass from net2Community gave a great seminar on sales. He started his presentation on selling Drupal by stating "Don’t sell Drupal, sell results!" So many times we become entrenched in the technology that we use and sell, and that’s ok!, but we have to remember that clients are more interested in the results we can provide, instead of the medium we use to get there. A good example given was a donut in a donut box. People rarely care about what box it comes in, they just want the donut!

Bob also brought attention to how each team member contributes to "selling", whether they realize it or not. The interactions, work and relationships that we manage on a daily basis help clients decide if they will continue to work with us or recommend us to their work colleagues.

Becoming a PM Ninja

Justin Rhodes from Commerce Guys led a good discussion on increasing efficiencies as a Project Manager. One of the first things we discussed was Parkingson’s Law: tasks will swell or shrink according to the amount of time given to them. If you use this law to your advantage, you can create small window deadlines to create efficiencies in your development process.

When it comes to planning and estimating phases for a project, Justin shared the success he has had doing this by using relativity to help the team give input. For example, rather than trying to nail down hours for each process step right way, you can tell everyone to estimate the size of the task by using shirt sizes (S, M, L, XL) to align everyone by using relative sizes. This can give the resource planner a clear visual of which parts of the project are going to take the longest. Of course, there are no complete replacements for old fashioned hourly estimates. The key to success on estimates is to check the team’s accuracy by comparing estimates against actual spend.

Contributing to Open Source

Our keynote speaker was Mike Anello from Drupal Easy. He gave a great talk on why we should be contributing back to the Drupal community. It wasn’t the typical, do it because it is the right thing to do, lecture. Mike made the case that not only does contributing back to the community grow your network and visibility, but it has a very real probability of increasing your bottom line. It is easy to say that we are going to contribute, but unless you deliberately set aside time, it probably isn’t going to happen. One way to make contributing a priority is to work it into your marketing budget. Switching your perspective on contributing from a way to get karma points to a powerful marketing tool, will change your priorities around where it fits into the company’s strategy.

The last take away I got from Mike’s talk was that even those of us who are nontechnical team members can contribute back to the Drupal community. Reaching out to module owners and asking how you can help, cleaning up ticket queues on modules, confirming bugs and assisting in documentation, are all ways to help move the ball forward (and I’m told they are greatly appreciated). Don’t forget that Drupal events don’t just happen by themselves. There is always a need for folks to help with the planning and coordination of meetups, camps and conventions.

Final Thoughts

Although I was unable to attend the pre and post party, I have no doubt that the enthusiasm of the group spilled into every conversation that was had. Who knows where I will be living next year (the benefits of working for a distributed company), but if I am able to, I’ll be returning to DrupalCamp Chattanooga!

(photo credit goes to @DrupalNooga)

Categories: Drupal Drupal 8 Field Labels - Hidden Vs Visually Hidden

17 November 2015 - 6:58am

Was trying out D8 and while “Managing Display” of a content type, noticed a new option while choosing the visibility of the label of a field.



Was wondering how they are different. Apparently when “Visually Hidden” is selected, the label is still there in the markup but not visible on browsers/screen, allowing screenreaders to be able to readout the label of the field!


Markup of the field label when set to “Visually Hidden”:


The motivation for this feature on d.o issue reads:

“As a site builder managing the display of a node, I want the option to hide field labels from sighted users, but make them visible to screenreaders, so I can make my site as accessible as possible without a custom theme.”


Had been hearing a lot about Drupal 8 accessibility features, but was pleasantly surprised to see this on my first brush with D8. Way to go Drupal! Can’t wait to see your new face in a couple of days!

Categories: Drupal

HollyIT: Vagrant + VirtualBox + New Windows 10 Update = OH NO!

17 November 2015 - 6:23am
Categories: DrupalPlanet DrupalTips

A quick post for others that might experience this same problem. Last night Windows 10, with its forced updates, provided me with the big update we've all been waiting for. As I awake, ready to go to work on Drupal 8 upgrades, I tried to start my Vagrant and jump right in. Suddenly I was hit with an error about the connection being in use. Quickly I opened VirtualBox and upgraded that. Once that updated, along with the extension pack, the error still persisted. Trying to open the boxes right from VirtualBox gave me a few more details about the error, but not much more.

Categories: Drupal

Kodamera Screencast: Drupal: Introduction and installation

17 November 2015 - 5:45am

Drupal is an awesome CMS (content management system), but it is so much more than just your ordinary blogposting system (though you can use Drupal for that as well). But the road to your own site (and perhaps internet success) must start somewhere, and if you want to set up a local environment on your computer to play around with Drupal (or any other PHP-driven system) you need a program or software to make this happen. In this introductory screencast I show you how to download MAMP and install that on your Macintosh computer, followed by how you download and install Drupal (8, the latest version). Download MAMP MAMP is a bundle of programs, made especially for running a local server on your computer. This means that an installation of Drupal can run on your own computer, not accessible for other people, only for you. To make your webpage accessible for the whole world, you need to upload your files and database to a hosting company of some kind and get some kind of domain name and point that to your hosting companys server. But I'm getting ahead of myself. Back to MAMP. You can find MAMP at Download and install the software first of all. The downloaded file ends up in your Downloads folder by default. If you choose some other folder, remember where you put it... Or download it again (yes, we have all made that mistake at least one time.) MAMP is freeware, but you can also buy MAMP Pro which is a more powerful solution if you want to handle or develop many sites simultaneously. Here, we will use the free version of MAMP for this introduction. With MAMP you also get a program called Sequel Pro, which is a program that let's you connect and handle databases. More on that later on. When the installation progress is finished, start the program and press "Start servers". When the on/off-icon turns green, your webserver is up and running. Good job! Download Drupal Next step is to download Drupal. Go to and choose Download & Extend in the top menu on the page. The Download & Extend page is your first step to downloading Drupal, themes and modules (plugins to Drupal). Is this case we just want to download Drupal, so click the green button. Next up, you get the choice to download different versions of Drupal, but we want the latest version. When we made this screencast the latest version was 8.0.0-rc1, but when you read/watch this, you should just choose the latest version of Drupal, which begins with and 8 (for example: 8.0.0, 8.0.1, 8.1.x etc and so on). The download file (.tar.gz och .zip) ends up in your Downloads-folder (see above). Doubleclick it to extract the files. Get ALL the files, not just the ones you see This is a bit tricky. To make Drupal work, you need all the files you've just extracted. The problem is that some of the files are hidden, and by default Macintosh computers don't show hidden files. There are programs that let you see hidden files, but you can also make the magic happen by writing a simple command in the Terminal program. Click your Spotlight magnifying glass-icon on your computer or open up a Spotlight search via your keyboard (most likely cmd+space) and type in Terminal. Terminal is a terminal emulator included in the OS X operating system by Apple (Wikipedia), and from that you can list files, create folders etc. In short, you can do almost anything you can to in i Finder window - but more. And to make hidden files be visible you open up a terminal windows and type defaults write AppleShowAllFiles YES Press Enter and on the next line, write killall Finder This sound horrifying, but it's ok, it doesn't kill something you're attached to (your kitten, your parents or your favourite snack or slippers). It just restarts the Finder application on Mac.  By now, if you open the folder the the extracted Drupal files are located in, you should see some files that are halfway see-through. These are the hidden files. Not to hidden now, ey?! Good. Now on to the next step of fun and glory! Choose the web docs folder We need to place the Drupal files in a folder that MAMP can use. If you swich to your MAMP window and press Preferences you can see four tabs: Start/Stop, Ports, PHP and Web server. Click the Web server tab. Here you can see where MAMP will look for the files to execute (run) Drupal. You can choose a completely different folder if you want, but I recommend you to use the folder MAMP suggests which is: Your harddrive > Application > MAMP > htdocs If you click the round icon with an arrow you open up a Finder window that shows the content of the folder we want to use. Let's move all the files Now that we can see all the files, even the hidden ones, we can choose all the files and either drag'n'drop them in the htdocs-folder we just opened.  Choose the Drupalfiles and press cmd+C if you want to copy the files, or drag the files and the folders to the htdocs folder. If you chose to copy and paste the files, just click somewhere in the htdocs window and press cmd+V to paste the copied files into that folder. It should end up looking something like this: Create a database You also need a database for Drupal to work. The database is where your content is stored, at least the text you enter as a blog post or story on your website. (Files you upload doesn't end up in the database, they are stored on the computer's hard drive.) To create a database you can use a program called Sequel Pro, that ships with MAMP. Open up the MAMP applications folder or start Sequel Pro via your Spotlight. Create a connection to the database by entering this information in this way: By default MAMP has set both the Username and Password to root. You also need to enter the port, which in MAMPs case is 8889. You can find this information under the tab named Ports, under MAMP Preferences. Back to Sequel Pro and press the blue button named Connect. If you have entered everything correct you will get connected to the database server. You should see a rather blank window like this. Choose Database in the menu and then Add database.  Choose a name that's easy to remember, for example drupal.  Choose UTF-8 Unicode (utf8) as Database Encoding. End this strange thing by clicking the button named Add. "Are we there yet?" Yes, yes we are. The next step is actually to start the installation of Drupal. Switch to your web browser and enter http://localhost:8888. This instructs MAMP to search the htdocs folder (where you have placed the Drupal files) and see what's there. MAMP will find Drupal's index.php that instructs Drupal to start an installation since we haven't don't that yet. http://localhost:8888 will result in this webpage: If you want some other language than English, you can choose this at this start screen. Language files will automatically load from Drupal's servers and set the default language to whatever you choose. Press Save and continue. Installations profiles Drupal can use installation profiles to make different settings to you system. In this screencast we will only use the standard one, so just click Save and continue during this phase. We will cover installation profiles in a later screencast. Database configuration Now it's time to tell Drupal where to find the database. The only things we need are the name of the database, the database username and password. We have all that so lets type them in. Database name: drupal (we entered that when we created the database earlier) Database username: root (MAMP default) Database password: root (MAMP default) Click Save and continue. Time to configure your site When you have entered the database credentials the installation starts. This will take a minute or so depending on how fast your computer is. It could also take up top 5-10 minutes if you have an older computer. During the installation process Drupal enables all the different parts of Drupal (modules) and sets up the system to make it work. We will cover the different parts in upcoming screencasts. When you see this the installation process is almost finished and it is now time to create your admin account and set the title of your website. Choose some classy and nice information for the following fields: Site name Site email address Username (this will be the first user account, the user/1 account, the head honcho, the big kahuna... you get the picure) Password (password for the big kahuna account, see above) Email address (for the big kahuna account, see above) Default county Default time zone You can also check for updates automatically. This will instruct Drupal to scan to see if there has are any new versions of Drupal and the modules you have downloaded and enabled. Good to know, but not vital if you are just playing around on your local computer. When you go live with your site, you should really see to it to keep your installation updated and secure. That's it! You are done. Drupal is installed and you can begin your Columbus-like journey through the menues and structure of Drupal. In the left part of the website you have the option to create content. Choose to create an Article for example and see what happens. We will make more screencasts on Drupal to make you discover more of Drupal. Check us out on Twitter, our RSS feed or YouTube channel to get continuous updates. Take care!
Read more
Categories: Drupal

ERPAL: How to sell Drupal support with value

17 November 2015 - 4:03am

Selling support is not so easy. Mostly you end up with agreements such as getting paid only if there’s a support request. If you want to provide reliable support with a well-defined response time, you need to allocate resources constantly, and that's why you need to get paid separately for the response time.

In this second post of our business support series I'll present you different kinds of support teams and pick up their pros and cons. Read more

Categories: Drupal

Sooper Drupal Themes: How To Improve Your Drupal Site's Traffic Using Google Search Console

17 November 2015 - 1:51am

As webmaster or owner of a Drupal website, it’s common practice to look out for new customers. It is also crucial to understand how prospective customers behave when they come to visit your website, and this is possible with the help of Google Analytics. Unfortunately Drupal site owners often fail to see the importance of their websites being properly crawled or indexed by Google. Now, Google has made things easier for businesses with Google Search Console (formerly webmaster tools) by directly communicating with website owners in order to help them get important information.

Google Search Console may not come with the trendiest user interface, but there’s more raw data in there than colorful charts and graphs. Using the system will help you improve your Drupal site's ranking in the Search Engine Results Pages (SERPs) if you take some time to learn how it works.

Let us now try to understand how GSC can help grow your business.

Why Use Google Search Console (GSC)?

Google Search Console is free if you have a Google account. It automatically opens a two-way communication channel between your website and Google. Search Console can help you monitor, maintain, and improve your website presence in Google’s search results. More specifically, once you log into Google Search Console, you will be able to see what search queries are tied to your business and where you could improve your website ranking. You will also be able to manage your website sitemaps, indexing of links, besides determining what Googlebot should be crawling and indexing content from your website.

How to Set Up GSC?

Setting up Google Search Console for your website is simple and easy. If you already have an account, look for it under Search Console. You just have to follow 3 simple steps:

Categories: Drupal

X-Team: Drupal 8: Finally Ready for Production

17 November 2015 - 12:37am

It’s been awhile since Drupal 8 was first ready to try out. But even since then, I was checking out news, reading updated docs, working on my Drupal 7 projects… still waiting for something real. And it finally happened – during the keynote at DrupalCon Barcelona, Dries announced the first D8 release candidate and basically...

The post Drupal 8: Finally Ready for Production appeared first on X-Team.

Categories: Drupal

Four Kitchens: Austin's Drupal 8 Launch Party Here we come!

16 November 2015 - 6:36pm

Join us and the rest of the Austin community for a well-deserved par-tay! We have quite the party planned: including BBQ, a cake, a pinata and even a raffle.

Categories: Drupal

Drupal @ Penn State: Cache warming authenticated sites with XMLRPC

16 November 2015 - 12:56pm

This video talks through how XMLRPC Page Load and HTTPRL Spider can be used to warm caches on private / authenticated sites. XMLRPC Page Load provides a callback that tricks Drupal into thinking that it’s delivering a page to certain user account. It does this by simulating page delivery but then never actually writing the output anywhere.

Categories: Drupal

Drupal @ Penn State: The future of Drupal under the hood

16 November 2015 - 12:56pm

I’m in the middle of several Drupal Camp / Con’s (any event over 1000 people is no longer a “Camp” but that’s for another time) and it’s occured to me: I can no longer learn by going. Now, this is learn in the traditional sense of what I used to go to Camps for (been coming to camps for 8 years now).

Categories: Drupal

Chromatic: TheaterMania: Lessons Learned on Localization

16 November 2015 - 12:28pm

We recently launched a new site for an existing client, TheaterMania. We helped launch and currently maintain and develop The Gold Club, which is a subscription-based discount theater club in New York City. The new site is the same thing, but in London – same language, same codebase, new database, different servers. We only had to migrate users, which were already exported for us, so nothing exceptional there. Shouldn’t be a big deal, right? We learned that’s not always the case.

Architectural Decisions

One of our first problems, besides the obvious localization issues (currency, date formats, language), was to decide what we were shipping. Were we just building another site? Were we packaging software? There will most likely be more sites in other cities in the future – how far did we want to go in terms of making this a product that we could ship? In the end, we wound up going somewhere in the middle. We had to decide initially if we would use Organic Groups to have one site with multiple “clubs,” one Drupal multisite installation, or multiple Drupal installations. The final decision was to combine the latter two choices – we created multisite-style directories so that if we need to take the site in a multi-site direction, we can easily do that. The sites each have a site-specific settings file, full of various configuration variables.

Now that the site has been launched, we’re not sure if this list of variables will be developer-friendly moving forward, and have been keeping in mind that we may want a more elegant solution for this. The best part about this setup is that we have one codebase, one master branch, and each site is configured to use the appropriate settings. The most important thing is that this is all very thoroughly documented, both in the code, README files, and the repo wiki.

Currency & Recurly: Easier than Expected

One of the issues I thought would be very problematic was currency, but that wasn’t actually an issue. All of the existing transactions are set up in cents – ie, 100 instead of 1.00 for a dollar, and that translates perfectly from dollars to pounds. We use Recurly, an external payment and subscription processor, so we didn’t have to worry about any localization issues on that front. Most of the currency abstractions I did were to remove any hard-coded references to the dollar sign, and create functions and variables to get the appropriate currency symbol.

Dealing with Dates; Ugh.

Date formats were something I expected to be easy, but that wound up being more complex. I discovered hook_date_combo_process_alter() to change the display of the date in calendar popup fields. This made what I’d thought was going to be a difficult series of view handlers really simple. We have several fields using the date combo box on both content types and entities, and this function took care of them.

* Implements hook_date_combo_process_alter().
* Changes the date format.
function gc_display_date_combo_process_alter(&$element, &$form_state, $context) {
  if (isset($element['#entity']->type)) {
    switch ($element['#entity']->type) {
      case 'event':
        $element['value']['#date_format'] = variable_get('date_format_short');

      case 'partner':
        $element['value']['#date_format'] = variable_get('date_format_short');
        $element['value2']['#date_format'] = variable_get('date_format_short');

      case 'promo_offer':
        $element['value']['#date_format'] = variable_get('date_format_short');
        $element['value2']['#date_format'] = variable_get('date_format_short');

  elseif (isset($element['#entity']->field_name)) {
    if ($element['value']['#instance']['widget']['type']  'date_popup' && $element['#entity']->field_name  'field_user_csr_notes') {
      $element['value']['#date_format'] = variable_get('date_format_short');

I took the dozen or so existing date formats from Drupal, altered some of them to meet our needs, and added a few more. My head also started spinning when testing because I’m so used to M/D/Y formats that D/M/Y formats look really strange after a while, especially because code changes needed to be tested on the US and UK sites, so I had to be really careful when visually testing a page to make sure that a US page was showing 9/1/15 and the UK page was showing 1/9/15. In the future, I’d definitely advocate for a testing suite on a project like this. Overall, making sure all of the dates were changed was somewhat tedious, but not difficult. It required a lot of attention to detail and familiarity with PHP date formats, and vigorous testing by the whole team to make sure nothing had been missed.

Proper Use of t() Early == Wins Later

This project made me extremely grateful for the t() function. Since both sites were in English, we didn’t have a need for site-wide translation, but we did need to localize a handful of strings, both for language issues (words like ‘personalize’ vs ‘personalise’), and the general language preference of the stakeholders. It was easy enough to find the strings and list them in locale_custom_strings_en to switch them out. One gotcha we came across that I wasn’t familiar with – you cannot use t() in your settings files. The function isn’t available at that point in the bootstrapping. You can use get_t(), but we opted to remove the translation strings from any variables and make sure that t() was used when the variable was called. This wasn’t something I had run into before, and it caused some problems before we figured it out.


A few tricky miscellaneous problems cropped up, too. There was a geolocation function enabled in Recurly, which was defaulting to the US and we were unable to change the settings – we also didn’t realize this when testing in the US, and we scratched our heads when the London team told us the field was defaulting to US until we came across the culprit. We were able to fix it, and put in a patch for the library causing the issue.

I also realized how many various settings default to the US when working on this project – a lot of the location-related work was just abstracting out country defaults. Something to keep in mind if you’re working on a project with locations. Don’t make more work for developers who live or work on projects outside of the US. Plan for the future! Assume nothing!

Looking Back

I’m really glad that I worked on this project, because it’s made me develop with a better eye for abstraction of all kinds, and making sure that it’s easy for developers or users to work with my code anywhere. In the future, I’d put more thought into managing our configurations from the start, as well as automating the testing process, both for time-saving and better QA.

If you’ve ever worked on a site with challenges like these, I’d love to hear how you handled them! What are your best practices for managing custom locale strings and other site-specific variables? To what extent do you abstract things like dates and currency when developing a site, even when you don’t know if those will ever change?

Categories: Drupal

about seo