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

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch created an issue. See original summary.

catch’s picture

Title: Remove pre-8.7.7 module compatibility checks » Remove pre-8.7.7 core compatibility checks in extension parsing
Issue summary: View changes

Version: 9.x-dev » 9.0.x-dev

The 9.0.x branch will open for development soon, and the placeholder 9.x branch should no longer be used. Only issues that require a new major version should be filed against 9.0.x (for example, removing deprecated code or updating dependency major versions). New developments and disruptive changes that are allowed in a minor version should be filed against 8.9.x, and significant new features will be moved to 9.1.x at committer discretion. For more information see the Allowed changes during the Drupal 8 and 9 release cycles and the Drupal 9.0.0 release plan.

xjm’s picture

Version: 9.0.x-dev » 9.1.x-dev
Status: Active » Postponed

The 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.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

catch’s picture

Status: Postponed » Active

Since 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.

longwave made their first commit to this issue’s fork.

longwave’s picture

Status: Active » Needs review
quietone’s picture

Version: 9.4.x-dev » 10.0.x-dev
Status: Needs review » Active
xjm’s picture

This 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?

longwave’s picture

Status: Needs work » Needs review

Fixed test failures.

joachim’s picture

Status: Needs review » Reviewed & tested by the community

  • catch committed 718fa09 on 10.0.x
    Issue #3077703 by longwave, catch, xjm: Remove pre-8.7.7 core...
catch’s picture

Status: Reviewed & tested by the community » Fixed

This 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!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

xjm’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs work
Issue tags: +Needs change record

Technically 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.

dww’s picture

Technically there is an API change here since the core key is now ignored completely

True.

which means you can't declare compatibility with both Drupal 8.7.6 and 10.0.0.

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 the core_version_requirement part? Couldn't you have a .info.yml file like this work everywhere?

core: 8.x
core_version_requirement: >= 8.0

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?

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.

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!

longwave’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record updates

I updated the change record a bit, I don't think there's a lot to say here though.

Gábor Hojtsy’s picture

Yeah core_version_requirement: ">=8" is one of the options suggested in the original core_version_requirement CR in https://www.drupal.org/node/3070687, that should allow to make modules Drupal 8 compatile. Could also use core_version_requirement: ^8 || ^9 || ^10.

catch’s picture

Status: Needs review » Fixed

The 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.