- Issue created by @pfrenssen
- last update
over 1 year ago 36 pass - @pfrenssen opened merge request.
- Status changed to Needs review
over 1 year ago 2:10pm 31 July 2023
We are currently declaring a compatibility with php: >=7.4
, drupal/core: >=9.1
and drush/drush: >=11
. This means we are formally declaring to Composer that our code is guaranteed to be fully compatible with all possible future versions of PHP and Drupal, including PHP 10, 11 and Drupal 11, 12 and so on. We cannot promise today that the module in its current form will work on any future version of PHP, Drupal and Drush. It's actually quite likely that the module code from today will NOT be compatible with Drupal 11, and it will definitely not be compatible with Drupal 15 in the year 2030.
We have a history of the >=
matching pattern causing problems when we transitioned the Drupal ecosystem from PHP 7 to PHP 8. The pattern was widely used and started causing trouble for modules that had previously unknown PHP 8 compatibility bugs. Modules started issuing new releases compatible with PHP 8. But the problem was that _older_ incompatible versions would still be installed by Composer due to using this permissive version declaration. Composer considers the _entire_ version history of a project when building the dependency tree. It will happily downgrade modules to ancient versions for as long as it finds one that resolves.
Even Drupal core was hit by this. Drupal 8.9 and 9.0 were not compatible with PHP 8. The first compatible version was Drupal 9.1. But due to the php: >=7.0
declaration these versions were still being installed by Composer. We had to intervene and update this version declaration. See
#3156651: Prevent Drupal 8.9 and 9.0 from being installed on PHP 8 →
. Unfortunately we could not go back in time and fix the string for earlier releases. Even up to today, if you are on PHP 8.2 and install Drupal 8 through Composer, it will decide that version 8.8.12 is the latest version that is compatible (since it declares php: >=7.0.8
) and will happily install that.
Declare version ranges with the actually supported and tested versions (e.g. drupal/core: ^9 || ^10
). Update these in the future as soon as we can guarantee compatibility.
Needs review
6.0
Code