drupal

A modern way to build and develop Drupal 8 sites, using Composer

The Drupal community has been on an interesting journey since the launch of Drupal 8 in 2015. In the past three years, as the community has started to get its sea legs 'off the island' (using tools, libraries, and techniques used widely in the general PHP community), there have been growing pains.

One area where the pains have been (and sometimes still are) highly visible is in how Drupal and Composer work together. I've written posts like Composer and Drupal are still strange bedfellows in the past, and while in some ways that's still the case, we as a community are getting closer and closer to a nirvana with modern Drupal site building and project management.

For example, in preparing a hands-on portion of my and Matthew Grasmick's upcoming DrupalCon Nashville lab session on Composer and Drupal, I found that we're already to the point where you can go from literally zero to a fully functional and complete Drupal site codebase—along with a functional local development environment—in about 10 or 15 minutes:

Updating drupal/core with Composer - but Drupal core doesn't update

For the past two minor release Drupal core upgrades, I've had major problems trying to get some of my Composer-based Drupal codebases upgraded. For both 8.3.x to 8.4.0, and now 8.4.x to 8.5.0, I've had the following issue:

  1. I have the version constraint for drupal/core set to ~8.0 or ~8.4 in my composer.json.
  2. I run composer update drupal/core --with-dependencies (as recommended in Drupal.org's Composer documentation).
  3. Composer does its thing.
  4. A few things get updated... but not drupal/core. It remains stubbornly on the previous minor release.

Looking around the web, it seems this is a very common problem, and a lot of people soon go for the nuclear (or thermonuclear1) option:

Getting Started with Lando - testing a fresh Drupal 8 Umami site

Umami demo profile running on Lando for Drupal 8
Testing out the new Umami demo profile in Drupal 8.6.x.

I wanted to post a quick guide here for the benefit of anyone else just wanting to test out how Lando works or how it integrates with a Drupal project, since the official documentation kind of jumps you around different places and doesn't have any instructions for "Help! I don't already have a working Drupal codebase!":

Two MidCamp Sessions: Local Dev for Dummies, Jenkins and Drupal

MidCamp 2018 wrapped up with a bang today, as there was another year full of great training, sessions, and my favorite aspect, the 'hallway track' (where you go around and network between and during some sessions with tons of excellent Drupalists from the Midwest and around the country).

This year, I presented two sessions; one a co-presentation with Chris Urban titled Local Dev Environments for Dummies, the other a solo presentation titled Jenkins or: How I learned to stop worrying and love automation.

Embedded below are the video recordings of the sessions (recorded as always by the excellent Kevin Thull of Blue Drop Shop!):

What do you use to build and develop Drupal sites?

tl;dr: Go complete the Drupal Local Development Survey, and we'll present the results (among other things) at MidCamp in a couple weeks!

Local development for Drupal is a subject I've invested a lot of time into. At the start of my Drupal journey, I used to use MAMP, then MAMP Pro, then a native *AMP installation. Then when I learned about Vagrant I started building Vagrant-based environments with shell scripts. Then I learned Ansible and started using Vagrant and Ansible. And then I learned Docker and used Ansible, Docker, and sometimes Vagrant!

Everyone's journey is different—but one thing most of us can agree on is: it ain't easy finding a way to run Drupal on your local workstation if you've never done it before.

Should you use MAMP/WAMP/XAMPP? Should you use Acquia Dev Desktop? Should you use Docker or Vagrant and build your own environment? Should you use a packaged solution like Drupal VM or Lando? And then how will you manage your codebase? How will you build a theme?

Drupal VM 4.8 and Drush 9.0.0 - Some major changes

tl;dr: Drupal VM 4.8.0 was just released, and it uses Drush 9 and Drush Launcher to usher in a new era of Drush integration!

Drush has been Drupal's stable sidekick for many years; even as Drupal core has seen major architectural changes from versions 4 to 5, 5 to 6, 6 to 7, and 7 to 8, Drush itself has continued to maintain an extremely stable core set of APIs and integrations for pretty much all the time I've been using it.

Drush.org homepage
New Drush version, new Drush website!

Drupal Camp St. Louis 2017 is a wrap!

The St. Louis Drupal Users Group (STLDUG) just finished it's fourth Drupal Camp, held at UMSL yesterday. I had a great time meeting with everyone, and am excited for next year! Last year I had to miss the Camp due to unexpected surgery, but this year I was able to attend and even bring some of my photo gear, to take pictures (I love contributing to open source through means other than code!); here's the obligatory 'whole camp' photo:

Drupal Camp St. Louis 2017 participants - group photo after Keynote

You can view all my photos from the camp in an album on Flickr: Drupal Camp St. Louis 2017 photos by geerlingguy

Apache, fastcgi, proxy_fcgi, and empty POST bodies with chunked transfer

I've been working on building a reproducible configuration for Drupal Photo Gallery, a project born out of this year's Acquia Build Hackathon.

We originally built the site on an Acquia Cloud CD environment, and this environment uses a pretty traditional LAMP stack. We didn't encounter any difficulty using AWS Lambda to post image data back to the Drupal site via Drupal's RESTful Web Services API.

The POST request is built in Node.js using:

Dealing with Drupal 8 and a giant cache_render table

There are a number of scenarios in Drupal 8 where you might notice your MySQL database size starts growing incredibly fast, even if you're not adding any content. Most often, in my experience, the problem stems from a exponentially-increasing-in-size cache_render table. I've had enough private conversations about this issue that I figure I'd write this blog post to cover common scenarios, as well as short and long-term fixes if you run into this issue.

Consider the following scenarios I've seen where a cache_render table increased to 10, 50, 100 GB or more: