Skip to content

Update core_version_requirement.

Cumulative Drupal 9 Readiness Patches.

This MR combines all the Drupal 9 compatibility patches from https://www.drupal.org/project/viewport/issues/3142075#comment-13639129 plus additional patches intended to address PHPCS errors and warnings.

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/

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

For Drupal 8 projects (about to be upgraded):

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

For Drupal 9 projects (after upgrading, but before D9-compatible module is released):

    "repositories": {
        "drupal/viewport": {
            "type": "vcs",
            "url": "https://git.drupalcode.org/issue/viewport-3142075"
        },
        "drupal": {
          "type": "composer",
          "url": "https://packages.drupal.org/9",
          "exclude": ["drupal/viewport"]
        },

Requiring the patched package from the Issue Fork:

Execute the following command in a terminal:

$ composer require drupal/viewport:dev-3142075-automated-drupal-rector

or manually add the requirement to composer.json:

    "require": {
        "drupal/viewport": "dev-3142075-automated-drupal-rector",

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

NOTE: The above code is not yet tested, so I may need to revise the instructions shortly. :)

Closes #3142075

Merge request reports

Loading