Is Your Module Ready for Drupal 9? Click Here to Find Out

On Contribution Day at MidCamp 2019, a team of us gathered to start the process of opening tickets about Drupal 9. We did this for the 300 most installed contributed Drupal 8 modules. We did this for the future of Drupal.

As you might know, the planned release of Drupal 9 is June 3rd, 2020 and end-of-life for Drupal 8 is planned for November 2021 at the latest. That is not a lot of time but there is no need for panic. The upgrade to Drupal 9 should not be scary if we take some action now.

Drupal 9 CMS Logo

Tools that made checking easy

We were able to open so many tickets in a day thanks to a project created by Matt Glaman called 'drupal-check' which "checks Drupal code for deprecations and discover bugs via static analysis". All it requires is a Composer installed Drupal 8 codebase in a local folder. No DB or server needed. This makes it easy for anyone to set up the tooling and check a module.

Meanwhile, at MidCamp, I got to give a talk about one of my favorite subjects in the world: Bash. As a result, I have been leveraging that tool more and more. It gave me the thought that I could make Bash do the lifting of running the report with a little scripting and I could focus on opening the ticket itself.

A report of all modules

After we finished analyzing the top 300, I asked myself "why not the rest?" So I asked Bash to do it, against the entire Module Project Index . The resulting report files are archived on my "Drupal 9 drupal-check Report" GitHub repository.  

To easily find the module report you are looking for, I suggest you clone the repo and search the Drupal-9-Drupal-Check-Report-Files for the machine name of the module, which is in the URL for the project page. For example, the Chaos Tool Suite (ctools) machine name is ‘ctools’. Or you can look it up on this spreadsheet

What I found

Chart view of the data in the following paragraphs


First, the good news. About 43.7% of all projects I analyzed have "No error", meaning the code base is Drupal 9 ready! For these modules, all that will be required is adding a drupalci.yml file to the project to tell DrupalCI that your module is ready to go for any Drupal 9 build. That’s all it takes.

The not so great news is that the other 56.3% of modules need some kind of a fix. The largest issue I can see is that 1,692 modules scanned, or about 24.6%, contain "drupal_set_message" as part of the errors. The replacement code is very straightforward and will help us standardize this widely used functionality for the future. Some module maintainers have already shown us the way.

Other issues are highlighted on the of the report project, like the 179 modules that threw fatal errors when installed by Composer or the 10 that contain "assertFieldByXPath". I built an analysis tool utilizing grep that is included in the repository if you would like to reproduce my results or expand on what I have done. All PRs will be considered.

The bad news is that I didn't open tickets for everything, just made this report. I did this in the hope of easing the path for module maintainers to get ready sooner. This is going to take some collaboration by us all.

A place for planning for the future

Beyond the tool itself, Matt and Joe Purcell have been using the drupal-check repository to help coordinate "Drupal 9 readiness". We, as members of the Drupal community, want to make it as easy as possible to get ready for Drupal 9 sooner rather than later. And we have a chance to get together and talk about this at every camp and conference during Contribution or Sprint days, including the largest one for those of us in or traveling to North America, DrupalCon.

DrupalCon Seattle 2019 Contribution Sprints are happening all week long the second week in April, with Friday dedicated to helping new folks contribute. If you are completely new to Drupal or think "well, I am not really qualified to code Drupal," you should come. There is a lot you can do to help, such as opening tickets or testing.

A brighter future

One of the ideals of Drupal 9 is that "the upgrade will be easy". I believe this is going to be true for all Drupal users if we work here and now together.

Together, we can ensure all code is ready for Drupal 9 and well beyond. Together, we are Drupal. Together we can make a difference. It's up to us. Hope to see you at DrupalCon or at another contributor day soon!

Topics Content, Development, Drupal, Drupal Hosting, Website Launch, Website Technology