Problem/Motivation
#2313917: Core version key in module's .info.yml doesn't respect core semantic versioning introduced logic to throw an exception when modules try to indicate pre-8.7.7 specific version compatibility - this is to mitigate against modules creating havoc on a pre-8.7.7 site that upgrades a contrib module without upgrading core.
Once we hit Drupal 9.2.0, Drupal 8 will be end of life (and the vast majority of modules will have correctly updated for Drupal 9 compatibility), so we could remove that code. This is not an API change as such, it's just removing some internal logic.
Drupal\Core\Extension\InfoParserDynamic
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
The core
key in extension info.yml
files is no longer supported. All projects must instead specify the core_version_requirement
key.
Issue fork drupal-3077703
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
catchComment #4
xjmThe release of 9.3.0 is actually closest to D8's end-of-life I think? In any case, I think this is postponed-for-now until 8.7 is at least a year out of support; we could make this change in 9.3.x and/or 10.0.x/9.4.x. Before that, we could add an
@todo
to the codebase.Comment #8
catchSince this is 100% a behaviour change rather than an API change, and also to put further distance from 8.x (like maybe sites with old versions of modules that aren't installed and haven't been updated) it might be a good candidate for a 10.x-only commit.
Comment #11
longwaveComment #12
quietone CreditAttribution: quietone at PreviousNext commentedComment #13
xjmThis issue (and related issues about core compatibility) can be considered should-haves for D10 beta, I think. It's essentially just dead code, but we have issues like #3139335: [D9 ONLY] The 'core_version_requirement' constraint requires the 'core' key not be set, but test modules might end up with both etc. so the more we clean up, the better.
I think this is actually needs work?
Comment #14
longwaveFixed test failures.
Comment #15
joachim CreditAttribution: joachim at Factorial GmbH commentedComment #17
catchThis looks great.
Just in case, going to leave it in 10.0.x - the situation I'm thinking of is if a site has old custom modules in the code base and updates from 8.9 to 9.4, given there's still about 100k 8.9 sites that's not impossible.
Committed/pushed to 10.0.x, thanks!
Comment #19
xjmTechnically there is an API change here since the
core
key is now ignored completely, which means you can't declare compatibility with both Drupal 8.7.6 and 10.0.0. Given the lack of overlap in security coverage it doesn't merit a release notes mention, but I think we should actually have a CR for it.Comment #20
dwwTrue.
Does it? If D10 is now completely ignoring
core
, then can't you use whatever works for D8 + D9 now, and D10 will just look at thecore_version_requirement
part? Couldn't you have a .info.yml file like this work everywhere?Early D8 only cares about `core` which works.
D9 cares but `core` and `core_version_requirement` agree and core_version_requirement matches and it works.
D10 ignores `core`, `core_version_requirement` is a match and it works.
Am I misunderstanding?
Here's a start:
https://www.drupal.org/node/3277275
I'm not sure what else to say until we resolve if this prevents anything from continuing to work.
Moving from 'Needs change record' to 'Needs change record updates'. 😉
Please advise. Thanks!
Comment #21
longwaveI updated the change record a bit, I don't think there's a lot to say here though.
Comment #22
Gábor HojtsyYeah
core_version_requirement: ">=8"
is one of the options suggested in the originalcore_version_requirement
CR in https://www.drupal.org/node/3070687, that should allow to make modules Drupal 8 compatile. Could also usecore_version_requirement: ^8 || ^9 || ^10
.Comment #23
catchThe CR looks good to me, enough of a breadcrumb if someone runs into something strange trying to sort out an old site or a very stale module, moving back to fixed.