Drupal 11 compatibility fixes for commerce

Created on 18 July 2024, 5 months ago
Updated 7 August 2024, 5 months ago

Problem/Motivation

Make this module compatible with Drupal 11.

Proposed resolution

Remove/update composer.json file with following changes.

"drupal/core": "^10 || ^11",
๐Ÿ“Œ Task
Status

Fixed

Version

3.0

Component

Other

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @chandu7929
  • Merge request !279Drupal 11 compatibility fixes. โ†’ (Merged) created by chandu7929
  • Pipeline finished with Success
    5 months ago
    Total: 472s
    #228044
  • Status changed to Needs review 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune
  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick

    There is also the core_version_requirement that has to change, and there is more that's needed, we need to remove the use of deprecated code... Was planning to come to that at some point.

  • Assigned to abhiyanshu
  • Status changed to Needs work 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune

    Thanks @jsacksick โ†’ if that's the case, we should broaden the tests to see what actually needs to be fixed. When I looked at the module's info.yml, I saw it was updated to ^10 || ^11

  • Pipeline finished with Failed
    5 months ago
    Total: 480s
    #228541
  • Pipeline finished with Failed
    5 months ago
    Total: 621s
    #228551
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia abhiyanshu

    @chandu7929 While scanning this module via Upgrade Status, I initially found 54 problems. After addressing many of them, only 40 warnings remain.
    I can confirm that apart from these warnings, the module is compatible with Drupal 11.

    However, most of the warnings appearing are related to the same issue mentioned below.
    i.e..,
    Twig template modules/contrib/commerce/modules/payment/templates/commerce-payment-total-summary.html.twig contains a syntax error and cannot be parsed.
    The 'commerce_cart/admin' library is not defined because the defining extension is not installed. Cannot decide if it is deprecated or not.
    Support from all Views contextual filter settings for the default_argument_skip_url setting is removed from drupal:11.0.0. No replacement is provided. See https://www.drupal.org/node/3382316.

    For additional clarity, please refer to the attached screenshot. Thanks!

  • Pipeline finished with Failed
    5 months ago
    Total: 659s
    #228773
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishalkhode

    vishalkhode โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Failed
    5 months ago
    Total: 447s
    #230876
  • Pipeline finished with Failed
    5 months ago
    Total: 442s
    #230880
  • Pipeline finished with Failed
    5 months ago
    Total: 493s
    #230883
  • Pipeline finished with Failed
    5 months ago
    #230884
  • Pipeline finished with Failed
    5 months ago
    Total: 604s
    #231198
  • Pipeline finished with Failed
    5 months ago
    Total: 649s
    #231794
  • Pipeline finished with Failed
    5 months ago
    Total: 673s
    #231808
  • Assigned to jsacksick
  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick

    There are some changes that seem wrong in the MR...
    Also, since this is 3.x, let's require Drupal 10.3 minimum so we can simplify code like the following:

    method_exists($renderer, 'renderInIsolation') ? 'renderInIsolation': 'renderPlain';

    I'll take this over, thanks for the work done so far.

  • Pipeline finished with Failed
    5 months ago
    Total: 475s
    #231847
  • Pipeline finished with Canceled
    5 months ago
    Total: 81s
    #231859
  • Pipeline finished with Failed
    5 months ago
    Total: 651s
    #231862
  • Pipeline finished with Failed
    5 months ago
    #231878
  • Pipeline finished with Failed
    5 months ago
    Total: 610s
    #231881
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune

    Hello @jsacksick โ†’ , I would request that you keep the temp commit as is (done for pulling incompatible modules that require running the D11 test in CI) until you are about to merge the PR changes. This will help other modules that require this module as dependencies, e.g., google_tag.

    Thanks!

  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick

    This commit? https://git.drupalcode.org/project/commerce/-/merge_requests/279/diffs?c...

    Profile is already D11 compatible, so I don't understand why we'd need to pull a specific MR? Will work on D11 compatibility for State machine, as for IEF, that might still be needed yes.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune

    Yes, I am talking about those commits, also profile is not compatible, listing compatibility on module page doesn't make compatible until its actually gets downloaded for D11 see my comments: https://www.drupal.org/project/profile/issues/3438568 ๐Ÿ“Œ Automated Drupal 11 compatibility fixes for profile RTBC

    If we allow dependent module to be pulled in using vcs, we can get opportunity to run the integration testing on D11 with other modules.

    Following change will be needed to run this module test on D11. I'll take look for State machine & IEF as well, all of the required module of commerce are under my radar.

    diff --git a/composer.json b/composer.json
    index 6568278a..f19bb8db 100644
    --- a/composer.json
    +++ b/composer.json
    @@ -11,18 +11,44 @@
             "drupal/address": "^2.0",
             "drupal/entity": "^1.0",
             "drupal/entity_reference_revisions": "~1.0",
    -        "drupal/inline_entity_form": "^1.0@RC || ^3.0@RC",
    -        "drupal/profile": "^1.2",
    -        "drupal/state_machine": "^1.5",
    +        "drupal/inline_entity_form": "^1.0@RC || ^3.0@RC || dev-3438428-automated-drupal-11",
    +        "drupal/profile": "^1.2 || dev-3438568-automated-drupal-11",
    +        "drupal/state_machine": "^1.5 || dev-project-update-bot-only",
             "drupal/token": "^1.7",
             "commerceguys/intl": "^2.0.6"
         },
         "require-dev": {
    -        "drupal/entity_print": "^2.2",
    -        "drupal/panelizer": "^5.0",
    -        "drupal/physical": "^1.3",
    +        "drupal/entity_print": "^2.2 || dev-3430201-automated-drupal-11",
    +        "drupal/panelizer": "^5.0 || dev-3433802-automated-drupal-11",
    +        "drupal/physical": "^1.3 | dev-project-update-bot-only",
             "drupal/mailsystem": "^4.3"
         },
    +    "repositories": {
    +        "state_machine": {
    +            "type": "vcs",
    +            "url": "https://git.drupalcode.org/issue/state_machine-3434761.git"
    +        },
    +        "profile": {
    +            "type": "vcs",
    +            "url": "https://git.drupalcode.org/issue/profile-3438568.git"
    +        },
    +        "inline_entity_form": {
    +            "type": "vcs",
    +            "url": "https://git.drupalcode.org/issue/inline_entity_form-3438428.git"
    +        },
    +        "entity_print": {
    +            "type": "vcs",
    +            "url": "https://git.drupalcode.org/issue/entity_print-3430201.git"
    +        },
    +        "panelizer": {
    +            "type": "vcs",
    +            "url": "https://git.drupalcode.org/issue/panelizer-3433802.git"
    +        },
    +        "physical": {
    +            "type": "vcs",
    +            "url": "https://git.drupalcode.org/issue/physical-3433920.git"
    +        }
    +    },
    
  • Pipeline finished with Failed
    5 months ago
    Total: 3113s
    #232051
  • Pipeline finished with Failed
    5 months ago
    Total: 497s
    #232116
  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick

    Profile & State machine both have D11 compatible releases...

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune

    Great!, Now I can see test running against D11 :https://git.drupalcode.org/issue/commerce-3462426/-/pipelines/232146

  • Pipeline finished with Success
    5 months ago
    Total: 585s
    #232146
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune

    The failing test against D11 are here which need action: https://git.drupalcode.org/issue/commerce-3462426/-/jobs/2206124

  • Pipeline finished with Failed
    5 months ago
    Total: 602s
    #232148
  • Pipeline finished with Success
    5 months ago
    Total: 460s
    #232154
  • Pipeline finished with Success
    5 months ago
    Total: 992s
    #232253
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajeshreeputra Pune

    The changes look good. However, we cannot merge them until the `composer.json` file is updated ๐Ÿ™‚.

  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick

    No this can't be merged as is and yes, we're going to need to remove the custom repositories and custom branches.
    But in order for Commerce to be fully compatible with D11, we need to make sure our dependencies have D11 compatible releases.

  • Pipeline finished with Running
    5 months ago
    #232776
  • Pipeline finished with Canceled
    5 months ago
    Total: 660s
    #232800
  • Pipeline finished with Success
    5 months ago
    Total: 971s
    #232806
  • Pipeline finished with Failed
    5 months ago
    Total: 453s
    #232849
  • Pipeline finished with Success
    5 months ago
    Total: 653s
    #232886
  • Pipeline finished with Failed
    5 months ago
    Total: 833s
    #232923
  • Pipeline finished with Running
    5 months ago
    #232933
  • Pipeline finished with Success
    5 months ago
    Total: 934s
    #232945
  • Pipeline finished with Canceled
    5 months ago
    Total: 161s
    #232969
  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick

    Tests are now finally green! However wondering if we shouldn't wait for the dependencies to have D11 compatible releases before merging this? Or I guess we can merge the changes and tests will pass once the dependencies will have D11 releases?

  • Pipeline finished with Canceled
    5 months ago
    #232964
  • Pipeline finished with Success
    5 months ago
    Total: 709s
    #232974
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune

    This only thing blocking this MR to merge and release is "drupal/inline_entity_form": "dev-3438428-automated-drupal-11", once we have IEF merge and release this should good to merge.

    We can ignore dev dependencies for now.

  • Pipeline finished with Success
    5 months ago
    #232995
  • Pipeline finished with Canceled
    5 months ago
    Total: 925s
    #233005
  • Pipeline finished with Success
    5 months ago
    Total: 599s
    #233018
  • Pipeline finished with Success
    5 months ago
    Total: 476s
    #233067
  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick

    I think I can still go ahead and merge those changes since the required changes for D11 to work are non dependent on Commerce anymore, and I wouldn't want the changes to become stale and have to handle conflicts later...

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune

    Make sense, but need to keep this issue open for other changes needed for D11 compatible release.

  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick

    Make sense, but need to keep this issue open for other changes needed for D11 compatible release.

    What are these?

  • Pipeline finished with Canceled
    5 months ago
    #233100
  • Pipeline finished with Canceled
    5 months ago
    Total: 436s
    #233107
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune

    What are these?

    Update latest release of IEF version in composer.json so that any module requiring commerce module should be able to download it. Later on for dev dependencies as well in order to make D11 CI passing

  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick

    Update latest release of IEF version in composer.json so that any module requiring commerce module should be able to download it. Later on for dev dependencies as well in order to make D11 CI passing

    That isn't needed, as soon as a D11 compatible release is going to be tagged, it is going to be picked up... Unless D11 support is added in a new major branch, but I'd expect the IEF 3.x branch to support D11, need to coordinate with the other maintainers on that.

  • Pipeline finished with Success
    5 months ago
    Total: 507s
    #233111
  • Pipeline finished with Running
    5 months ago
    #233119
  • Status changed to Fixed 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ฑIsrael jsacksick
  • Pipeline finished with Failed
    5 months ago
    Total: 624s
    #233134
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Pipeline finished with Skipped
    4 months ago
    #274005
  • Pipeline finished with Success
    about 2 months ago
    Total: 66s
    #326153
  • Pipeline finished with Success
    about 2 months ago
    Total: 177s
    #326156
  • Pipeline finished with Success
    about 1 month ago
    Total: 778s
    #342170
  • Pipeline finished with Success
    about 1 month ago
    Total: 179s
    #342180
Production build 0.71.5 2024