Skip to main content

Working with Drupal 9

Drupal 9 honed the best of the more modern approaches of Drupal 8, targeting ambitious digital experiences. Legacy code was cut out, internal components were upgraded, and there has been a new focus on being brilliant 'out of the box'.

Take a look at some of our Drupal 9 posts below...

Read some of our articles about Drupal 9

Removing invalid query string parameters passed to a view

3rd May 2023

As a Drupal site administrator, you may notice in the website logs that there might be a large number of repeated log messages along the lines of "An illegal choice has been detected. Please contact the site administrator." We recently had this problem on a Drupal site that was upgraded from Drupal 7 to Drupal 9 which featured a product search that was built using Views.

Due to slight differences in the way in which the view and facets were built in the Drupal 9 site, this resulted in slightly different URLs being used when the user would filter the...

Read more

How to: Implement an automated Commerce Order state transition

3rd Apr 2023

A common requirement for any website that sells products is to have a mechanism in place that ensures orders placed on the website are 'Exportable' - being made available as a file that can be sent across to a different system, to handle the processing of the order.

The Drupal Commerce 2.x module (for Drupal 9, 10) has the concept of order 'Workflows', along with defined 'States' and 'Transitions'. A workflow is a set of states and transitions that the order will go through during its lifecycle. Transitions are applied to an order and this will progress the order from...

Read more

Migrating cropped images

13th Mar 2023

One of our big Drupal 7 to Drupal 9 migration projects included bringing across image cropping functionality and data on a longstanding client's website. This site had used the Imagefield Crop module, but that was only for Drupal 7. We set up Image Widget Crop for the new site, which is better in a few ways but is also fundamentally different. The old site referenced the cropped images from content, only bringing in the originally-uploaded images for edit pages, to allow editors to adjust the cropping, which was then used wherever that image appeared on the frontend. But the new Image Widget Crop module allows configuring different crops for different situations.

The real challenge was in migrating the data! But we call ourselves Drupal experts, so of course we dug to find solutions. We found the following steps were necessary...

Read more

Migrating Drupal 7 Files into Drupal 8 / 9 Media entities

27th Jul 2021

This article assumes a basic knowledge of the building of custom modules, the Drupal 8 / 9 Migration system, and the processes behind creating customised migrations from a previous version of Drupal.

One of the more common components of any migration from a previous version of Drupal is the need to migrate files. In Drupal 7 there was a core ‘File’ entity type and on pretty much all of our clients' sites we would also have the contributed module File Entity enabled. This extended the core file functionality and gave the ability to add fields to the file entity, have...

Read more

Apply Drupal 9 compatibility patches with Composer

12th Jan 2021

Update! Since this article was written, a new 'lenient' composer endpoint has been created on Drupal.org to support using modules with Drupal 9 that haven't been marked as compatible with it yet. See the documentation, which boils down to adding a new common entry under 'repositories' in your composer.json, above the usual https://packages.drupal.org/8 one. The rest of this article is still useful for understanding how patching fits into composer's workflow.

The vast majority of community-contributed Drupal 8 modules now have releases that are compatible with Drupal 9, but what can you do if you need to use a module that...

Read more

Rendering fields in Drupal 9 (the right way)

Part of the series
Upgrading to Drupal 9
28th Jul 2020

Many of us at ComputerMinds have always taken pride on doing Drupally things the right way whenever possible, and then helping the community do so too. One of these things is displaying values from fields on content entities. We wrote before about how to do this in Drupal 7 and Drupal 8. It's now the turn of Drupal 9! Thankfully, this updated version is basically the same as the last one, as D9 is very similar to D8 on the surface, but with old cruft ripped out to allow it to continue improving. So the short answer to "How...

Read more

Drupal 9, it's here!

Part of the series
Upgrading to Drupal 9
4th Jun 2020
Drupal 9 logo

Update: Since writing this article the EOL of Drupal 7 has been extended from November 2021 until November 2022.

It’s here! June 3rd 2020 marks the official release date of the first production ready version of Drupal 9. It feels like Drupal 8 was only released a short while ago but it turns out it’s been 4.5 years already! The release of any new major version of Drupal is an exciting milestone in the project’s history and with a shiny new brand logo in place, Drupal 9 is ready to hit the ground running.

We are already well underway doing...

Read more

Upgrading your website to Drupal 8 or 9

Part of the series
Upgrading to Drupal 9

Update: Since writing this article the EOL of Drupal 7 has been extended from November 2021 until November 2022.

Your current website/platform is built on Drupal 7 and news has hit your ears about 7’s end of life (EOL). Maybe your website is a Drupal 8 website and you want to know what the future has in store for you. Good news is, you don’t have to do anything immediately, but it is definitely a question that you want to start thinking about very soon.

This article is mainly aimed at Drupal 7 builds looking to upgrade to 8 or...

Read more