Skip to content

D9 Compatibility, plus Standards and Practice.

Drupal 9 Compatibility, plus Standards and Practice.

This MR combines the Drupal 9 compatibility patch from:

https://www.drupal.org/project/ms_ajax_form_example/issues/3117909#comment-13752939

with a patch to the core_version_requirement in info.yml allowing the module to be installed on Drupal 9,

and adds patches for Drupal coding standards and practice.

It is useful to have an issue fork for Drupal 9 compatibility, rather than simply a patch, because:

In short, you can't use a patch to tell Composer that a Drupal 8 module is compatible with Drupal 9.

Source: https://www.mediacurrent.com/blog/how-fix-catch-22-problem-drupal-9-fixes-composer/

Adding Issue Fork as a Composer repository:

To use this issue fork as a transitional D9-compatible package in your project, modify your composer.json:

    "repositories": {
        "drupal/ms_ajax_form_example": {
            "type": "vcs",
            "url": "https://git.drupalcode.org/issue/ms_ajax_form_example-3117909"
        },
        "drupal": {
          "type": "composer",
          "url": "https://packages.drupal.org/8",
          "exclude": ["drupal/ms_ajax_form_example"]
        },

Requiring the patched package from the Issue Fork:

Execute the following command in a terminal:

$ composer require drupal/ms_ajax_form_example:dev-3117909-drupal-coding-standards

or manually add the requirement to composer.json:

    "require": {
        "drupal/ms_ajax_form_example": "dev-3117909-drupal-coding-standards",

Credit due, mainly, to Benji Fisher via: https://www.drupal.org/project/views_url_alias/issues/3142138#comment-14177409

NOTE:

Instructions above tested (with Drupal 8.9.18) and patched module now passes Upgrade Status tests.

Not yet tested with Drupal 9. You can help the Drupal community by testing this! 👍

Closes #3117909

Edited by Matt Obert

Merge request reports

Loading