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

Drupal 10: What's that all about then?

7th Mar 2023

Years ago, when Drupal 8 was released not only did it usher Drupal into the modern age of PHP frameworks and CMSs but it changed how Drupal upgrades were managed and controlled.
Gone were the days of painful major upgrades with frequent compatibility breaks; instead we got lovely 6 monthly upgrades that added functionality followed by occasional major releases that removed old code and marked certain features as old ('deprecated' in technical jargon).

Several years later and we've seen not only the release of Drupal 9 in 2020 but Drupal 10 in the last few months.

If you have a...

Read more