Drupal 8 is ready for prime time, but here's what you should plan for

The Engagement 4Cast

Drupal 8 is ready for prime time, but here’s what you should plan for

Michael Wilson

Blog

03/30/2016

Michael Wilson

You may have noticed our new website (launched but being improved), and we built it on Drupal 8!  As you may know, Drupal 8 is an object-oriented framework, which I love. Everything is a class that can be extended, which makes the entire process of doing custom development much, much easier, and probably safer overall. But if a client asked me to build their site on Drupal, I’d probably say… “Yes, but be prepared for a little pain.”

First off, many of the most useful modules have been moved into core: Views is the most notable.  As a result, the number of contrib modules I install has drastically decreased in number.  I like this!

Contribute this

And as to the pain, here’s a list of contrib modules that I normally rely on that are not yet ported over to D8, or don’t have a stable release:

Other gotchas

I found a bug with taxonomy-based sub-queries both in views AND in custom entityQuerys.  To summarize, using a sub-query to filter by taxonomy would do nothing, or I found inconsistent results.  I implemented a workaround by structuring my custom queries differently and using custom blocks instead of views.

I also discovered that installing/uninstalling modules ALWAYS white-screens.  This hasn’t resulted in any serious issues (SMTP module being the exception–I can’t uninstall it).

And debugging is painful!  This may be due to the hosting environment configuration (Pantheon).  I found that I rarely see errors (instead, I see the page processing halt at the content generation point, or a WSOD).  So the bulk of my debugging involved kint and careful scrutiny of the logic.  I also found that twig dump wasn’t working.  Again, possibly due to the server configuration, but I’m not certain.

The Disqus module is easy to use, as before.  I found that enabling the disqus comments AFTER your content is migrated is a bad, bad idea.  Reason for this is that disqus commenting must be manually enabled on EACH and EVERY node if done AFTER the content is entered.  So, all 72 blog posts had to be edited and re-saved. 

What about media, you ask. There weren’t any good solutions for rendering video, so I ultimately wrote a custom field formatter for a link field, for easy embedding of responsive Vimeo video.  I ddidn’t mind this, because it gave me the opportunity to write the field formatter, which was fun to do. Same issue with audio.  Ultimately I created a second custom field formatter for our podcasts.

Go Drupal 8!

Overall, I love Drupal 8, mostly due to the object-oriented framework.  Our frontend developer loves his twig templates.  Accessing node fields is so easy, now, with get methods on the node to get at the data (I have strong memories of dumping node arrays to the screen in D7 so that I could determine the exact path to the field value I needed). Also, you now bundle CSS and JS into a single “library” in your library yml file, and include the single library with your block, rather than separate CSS and JS includes.  Seems so much cleaner to me.

So if you are thinking of moving to D8, I say, “Go for it.”

About the Engagement 4Cast

4Site Interactive Studios is a talented troupe of web professionals who are passionate about creating tools to support digital marketers. We love to hear from our community! Reach out to us with your thoughts and questions. And don’t forget to subscribe below to get notified when we post new blogs – no spam, just content👍🏼

Subscribe & stay ahead of the crowd with sage marketing tips and predictions.

How can we help?