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, without a line containing core.

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

Comments

Harshita mehna created an issue. See original summary.

harshita mehna’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new441 bytes

Hello Maintainers,
I have provided a patch for this issue.
To get more information visit https://www.drupal.org/node/3070687
Please review.

Thanks!

rollins’s picture

I can confirm that patch #2 resolved the bug.
thank's Harshita mehna!

harshita mehna’s picture

@rollins Thanks for the review.

avpaderno’s picture

Title: The core: 8.x key must not be used here. » Remove "core: 8.x" from the .info.yml file
Category: Bug report » Task
Issue summary: View changes
Status: Reviewed & tested by the community » Closed (works as designed)

Modules, themes. and profiles are allowed to use the following lines in their .info.yml file.

core: 8.x
core_version_requirement: ^8 || ^9

That is described 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

There is no change that must be done in that .info.yml file.