Support both Commerce 2 and 3.

Created on 10 February 2025, 11 days ago

Problem/Motivation

The 3.0.x branch only supports Commerce 3, although it also supports Drupal 10 which can still run Commerce 2. Drupal 10 is still a supported release, and so is Commerce 2.

There is no significant difference between supporting Commerce 2 and 3 other than a number in the composer.json file. The code difference between the two is in this commit: https://git.drupalcode.org/project/commerce_checkout_order_fields/-/comm...

It would make it significantly easier for admins upgrading from Drupal 10 + Commerce 2 -> Commerce 3 -> Drupal 11 if they didn't need to update many different modules during that last step. At present I need to fork and mirror this project so that I can change the composer.json file as that can't be patched.

If this module just stated that it supported both Commerce 2 and 3 (which code-wise it does since there's no significant different), then it is trivial to update this module before updating Commerce 2->3.

In addition, there is an inconsistency between the .info.yml and composer.json on the supported Drupal core version; there is no need to include the supported code in the composer.json file as it is automatically included by the drupal composer handling.

Steps to reproduce

Try to update to 3.0.x of this module on a still supported Drupal 10 + Composer 2 site.

Proposed resolution

Update composer.json file to:

  • Support Commerce "^2.4 || ^3"
  • Remove Drupal Core specification

Remaining tasks

Change, Review, critique, commit.

User interface changes

none

API changes

none

Data model changes

none

🐛 Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

🇦🇺Australia elc

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024