[D9 ONLY] The 'core_version_requirement' constraint requires the 'core' key not be set, but test modules might end up with both

Created on 23 May 2020, over 4 years ago
Updated 10 January 2024, 11 months ago

Problem/Motivation

Drupal\Core\Extension\InfoParserException: The 'core_version_requirement' constraint (9.0.0-rc1) requires the 'core' key not be set in modules/contrib/upgrade_status/tests/modules/upgrade_status_test_contrib_error/upgrade_status_test_contrib_error.info.yml

Originally, reported by @Matroskeen on slack.

Proposed resolution

@berdir:

the problem is the magic that is in core for test modules

which automatically get a working core_version_requirement (edited)

but the problem is that D9 doesn't look for a core key when doing that

so you have two options: if you require at least 8.8.3, you can remove the core key. support anything below, add a core_version_requirement yourself

IMHO this test-module logic in D9 should check for a core key, so that you get a less-confusing "test module X is not compatible with D9" error instead of this

if someone wants to improve this, the logic is in

\Drupal\Core\Extension\InfoParserDynamic::parse()

I think we just need to extend this condition with a check for core being set: "

elseif (isset($parsed_info['package']) && $parsed_info['package'] === 'Testing') {"

not sure if there's an easy way to test it

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡¨πŸ‡³China jungle Chongqing, China

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024