Skip to content
Snippets Groups Projects

Cumulative Drupal 9 Compatibility Patches.

Cumulative Drupal 9 Compatibility Patches.

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.

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-call-to-deprecated

or manually add the requirement to composer.json:

    "require": {
        "drupal/ms_ajax_form_example": "dev-3117909-call-to-deprecated",

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

NOTE:

Not yet tested with Drupal 8. You can help the Drupal community by testing this! :thumbsup:

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

Closes #3117909

Edited by Matt Obert

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Matt Obert changed the description

    changed the description

  • Matt Obert added 1 commit

    added 1 commit

    • 5f9230b0 - Add composer.json to project root.

    Compare with previous version

  • This one didn't work without composer.json:

    $ composer require drupal/ms_ajax_form_example:dev-3117909-call-to-deprecated
    
                                                                                                                                                                 
      [Composer\Repository\InvalidRepositoryException]                                                                                                           
      No valid composer.json was found in any branch or tag of https://git.drupalcode.org/issue/ms_ajax_form_example-3117909, could not load a package from it.
    
    

    I added a composer.json with values copied from composer.lock, and it appears to work:

    $ composer require drupal/ms_ajax_form_example:dev-3117909-call-to-deprecated
    ./composer.json has been updated
    Running composer update drupal/ms_ajax_form_example
    Gathering patches for root package.
    Removing package drupal/ms_ajax_form_example so that it can be re-installed and re-patched.
      - Removing drupal/ms_ajax_form_example (1.0.0)
    Deleting docroot/modules/contrib/ms_ajax_form_example - deleted
    Loading composer repositories with package information
    Updating dependencies                                 
    Lock file operations: 0 installs, 1 update, 0 removals
      - Upgrading drupal/ms_ajax_form_example (1.0.0 => dev-3117909-call-to-deprecated 8.x-1.0)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
      - Syncing drupal/ms_ajax_form_example (dev-3117909-call-to-deprecated 8.x-1.0) into cache
    Gathering patches for root package.
    Gathering patches for dependencies. This might take a minute.
      - Installing drupal/ms_ajax_form_example (dev-3117909-call-to-deprecated 8.x-1.0): Cloning 8.x-1.0 from cache
    Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
    Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
    Generating autoload files
    Hardening vendor directory with .htaccess and web.config files.
        Skipped installation of bin bin/composer for package composer/composer: file not found in package
    65 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    Cleaning installed packages.

    However, after installation the patch is not applied.

    I have a lot of packages to update in order to make this project compatible with Drupal 9, and I can't spend too much time on any one of them, so I'll need to circle back to this module in a few days.

  • Matt Obert mentioned in merge request !2

    mentioned in merge request !2

  • Matt Obert changed the description

    changed the description

  • Matt Obert added 1 commit

    added 1 commit

    • 6980a1fc - Create a valid composer.json.

    Compare with previous version

Please register or sign in to reply
Loading