23 Jan 2026

feedDrupal.org aggregator

Dripyard Premium Drupal Themes: How an unclosed broke Drupal’s JavaScript

Sometimes you hit a bug and your brain just goes, "huh."

That was me earlier this week while trying to figure out why Drupal's JavaScript was completely broken. But only on one page. And of course, this happened during a live demo!

You can actually see the moment it went sideways here. This is the story of how I tracked it down.

The problem

Dripyard adds a bunch of options to our theme settings pages. On one particular theme, Great Lakes, the settings page was loading with JavaScript absolutely wrecked.

23 Jan 2026 3:15pm GMT

Joachim's blog: Converting hooks to OO methods made easy

Converting hooks to OO methods made easy

Rector is a really powerful tool for making refactoring changes to your codebase. It's easy to use, but it's not obvious, and a lot of the documentation and articles about it are outdated or incomplete. For instance, when you go to the project page (https://www.drupal.org/project/rector) there's no clear indication of how to install it!

More and more of the code changes needed to keep your modules up to date with Drupal core are being written as Rector rules. I wrote recently about converting plugins to PHP attributes; the other big change in Drupal at the moment is hooks changing from procedural functions to class methods.

Here's the steps I took to convert the hooks in the Computed Field module:

  1. Install Rector in your project. As mentioned earlier, finding the installation instructions is not obvious: they're in the github project:
composer require --dev palantirnet/drupal-rector
cp vendor/palantirnet/drupal-rector/rector.php .

This puts a rector.php file in your project root. What to do with this isn't immediately obvious either, but fortunately, in the PR for OO hook conversion there is sample code. The key part is this:

  $rectorConfig->rule(\DrupalRector\Rector\Convert\HookConvertRector::class);

You can then run Rector on your code. Remember to commit any existing changes to git first: this Rector rule changes a lot, and it's good to be able to revert it cleanly if necessary.

vendor/bin/rector process path/to/my_module

This does the conversion: hook implementation code is copied to methods in new Hook classes, and the existing hook implementations are reduced to legacy wrappers.

However, the code is all formatted to ugly PHP PSR standards. Import statements in .module file for use inside hook code will also remain. So we turn to PHPCS, which can re-format the code correctly and clean up the imports. I chose to target just the .module file and the Hook classes:

vendor/bin/phpcbf --standard=Drupal --extensions=php,module path/to/my_module/src/Hook
vendor/bin/phpcbf --standard=Drupal --extensions=php,module path/to/my_module/my_module.module

At this point, you should run your tests to confirm everything works, but the conversion should be complete.

You can of course now choose to do further refactoring on your hooks class, such as splitting it into multiple classes for clarity, moving helper functions into the class, or combining multiple hooks.

joachim

23 Jan 2026 11:49am GMT

Droptica: 10 Common Drupal Maintenance Problems And How to Avoid Them

- Good Drupal maintenance services require deep knowledge of Drupal and understanding of typical challenges that may arise. These problems often stem from suboptimal processes, lack of automation, and insufficient skills of specialists managing the site. At Droptica, we understand these challenges well and thanks to our experience, we know how to address them effectively. In this article, we present 10 most common Drupal maintenance problems, their business consequences, and ways to avoid them.

23 Jan 2026 11:16am GMT