Adding both core and core_version_requirement with anything other than core_version_requirement: ^8 || ^9 will result in an exception.

For example, a module/theme that is compatible with Drupal 8 versions after Drupal 8.8.0 and also Drupal 9 will need to use the following line in its .info.yml file.

core_version_requirement: ^8.8 || ^9

In the rare occasions the module/theme is also compatible with Drupal 10, its .info.yml file should use the following line.

core_version_requirement: ^8.8 || ^9 || ^10
CommentFileSizeAuthor
#5 3375430_5.patch417 bytesrohitsharma401
#2 3375430-2.patch386 bytesharshita mehna
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:

Comments

Harshita mehna created an issue. See original summary.

harshita mehna’s picture

Status: Active » Needs review
StatusFileSize
new386 bytes

Hello Maintainers,
I have provided a patch or an MR !3 to fix this issue.
Please review it.

Thanks!

avpaderno’s picture

Priority: Normal » Minor
Status: Needs review » Needs work
-core: 8.x
 core_version_requirement: ^8 || ^9 || ^10

Since core is removed, core_version_requirement needs to be changed to core_version_requirement: ^8.8 || ^9 || ^10. Earlier Drupal 8 releases do not recognize core_version_requirement; the module is not installable on those releases, if it uses just core_version_requirement.

rohitsharma401’s picture

Status: Needs work » Needs review
StatusFileSize
new417 bytes
avpaderno’s picture

Status: Needs review » Needs work

The MR contains changes that are not related to this issue.

The patch is not correct.

 core: 8.x
-core_version_requirement: ^8 || ^9 || ^10
+core_version_requirement: ^8.8 || ^9 || ^10

Since core_version_requirement is changed, core must be removed.

avpaderno’s picture

Title: Do not allow core: 8.x in info.yml file. » Remove "core: 8.x" from the .info.yml file
harshita mehna’s picture

Status: Needs work » Needs review

@apaderno, The core key is removed now please check the commit 239ce263.
Putting the issue in needs review again please review.

avpaderno’s picture

This is a change only maintainers can decide to do.
It has been introduced the compatibility with Drupal 10, but I doubt maintainers want to keep the code compatible with three different Drupal versions.

Also, nothing is wrong in using core: 8x together core_version_requirement: ^8 || ^9. Drupal core allows it and it is also shown in New 'core_version_requirement' key in info.yml files for modules, themes and profiles allows Composer semantic version constraints including specifying multiple major versions of core, which states:

For example a module that is compatible with Drupal 8 and Drupal 9 can have a info.yml file like this

name: My Module
type: module
core: 8.x
core_version_requirement: ^8 || ^9

laboratory.mike made their first commit to this issue’s fork.

laboratory.mike’s picture

Status: Needs review » Fixed

I'm starting to do some updates for VAR, and went ahead and included the existing commits and move to support D9/D10 in the 2.0.x version. Thanks all for the feedback and working through this.

Status: Fixed » Closed (fixed)

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