Posted on Thu Aug 12 2021 • Written by Benji Fisher
Modified on: Mon Jan 02 2023
.info.yml
file. For some modules, that is the only step needed.
Once the module has been updated, it’s easy to install it on a Drupal 9 site. But there is a chicken-and-egg problem if some helpful contributor has proposed a change to the module, but the maintainer has not yet adopted it. Perhaps you maintain a Drupal 9 site and want to add that module, or perhaps you are one of the helpful contributors who plans to test the change. Since the module does not declare compatibility with Drupal 9, the usual way of installing the module (and applying the change) does not work.
This seems to be the easiest way to install a module with Drupal 9, if the module is in that in-between stage where the necessary changes have been proposed but not yet adopted. This assumes that you manage Drupal with Composer. Using Composer is the recommended method for Drupal 8/9, and it is required for some modules.
https://git.drupalcode.org/issue/views_url_alias-3142138
. The last part of the URL is the link text: views_url_alias-3142138.git checkout -b '3142138-automated-drupal-9' --track views_url_alias-3142138/'3142138-automated-drupal-9'
The part in quotes after git checkout -b
is the branch name.composer.json
for your Drupal project. Add a section to the top-level repositories key like this:
"repositories": [ { "type": "vcs", "url": "https://git.drupalcode.org/issue/views_url_alias-3142138" }, ... ]For the
url
key, use the Issue fork URL.drupal/PROJECT:dev-BRANCH
. Continuing with the same example, open a shell and run this command:composer require drupal/views_url_alias:dev-3142138-automated-drupal-9
If all goes well, then Composer will update composer.json
and download the module with all of its requirements. Enable the module and see whether it works with Drupal 9.
Remember to close the loop. You are benefiting from all the helpful contributors, and the way to show your appreciation is by posting a comment to the issue. Did it work? Were there any problems? Either way, give details!