If I try to clear the cache then this error appears:

The 'core_version_requirement' constraint (^8.7.7 || ^9) requires the 'core' key not be
   set in modules/contrib/stage_file_proxy/stage_file_proxy.info.yml

To get rid of that error and ensure the module cannot be installed on outdated versions of core (where the Deprecation related changes will cause issues) we should get ride of the "core:" value from the info file.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

saschaeggi created an issue. See original summary.

saschaeggi’s picture

Issue summary: View changes
greggles’s picture

Are you using 8.x-1.0-rc1 or 8.x-1.x-dev?

We just added core_version_requirement to 8.x-1.x-dev but it's not in 8.x-1.0-rc1. This issue is tagged to 8.x-1.0-rc1.

Are you clearing cache via the admin UI or via something like `drush cr`?

greggles’s picture

Status: Active » Postponed (maintainer needs more info)

I just tried this on simplytest.me with 8.7.8 core and was unable to observe this issue with either 8.x-1.0-rc1 or 8.x-1.x-dev.

saschaeggi’s picture

Version: 8.x-1.0-rc1 » 8.x-1.x-dev

Sorry my fault it was on dev, not rc1 :-)

saschaeggi’s picture

To reproduce it: try it with drush (9)

geek-merlin’s picture

Strange. From the InfoParserDynamic code:

+      if (isset($parsed_info['core_version_requirement'])) {
+        $supports_pre_core_version_requirement_version = static::isConstraintSatisfiedByPreviousVersion($parsed_info['core_version_requirement'], static::FIRST_CORE_VERSION_REQUIREMENT_SUPPORTED_VERSION);
+        // If the 'core_version_requirement' constraint does not satisfy any
+        // Drupal 8 versions before 8.7.7 then 'core' cannot be set or it will
+        // effectively support all versions of Drupal 8 because
+        // 'core_version_requirement' will be ignored in previous versions.
+        if (!$supports_pre_core_version_requirement_version && isset($parsed_info['core'])) {
+          throw new InfoParserException("The 'core_version_requirement' constraint ({$parsed_info['core_version_requirement']}) requires the 'core' not be set in " . $filename);
+        }
+        // 'core_version_requirement' can not be used to specify Drupal 8
+        // versions before 8.7.7 because these versions do not use the
+        // 'core_version_requirement' key. Do not throw the exception if the
+        // constraint also is satisfied by 8.0.0-alpha1 to allow constraints
+        // such as '^8' or '^8 || ^9'.
+        if ($supports_pre_core_version_requirement_version && !static::satisfies('8.0.0-alpha1', $parsed_info['core_version_requirement'])) {
+          throw new InfoParserException("The 'core_version_requirement' can not be used to specify compatibility specific version before " . static::FIRST_CORE_VERSION_REQUIREMENT_SUPPORTED_VERSION . " in $filename");
+        }
+      }
saschaeggi’s picture

Status: Postponed (maintainer needs more info) » Active

If i try to use either drush cr or drush updb I get

In InfoParserDynamic.php line 55:

  The 'core_version_requirement' constraint (^8.7.7 || ^9) requires the 'core' key not be set in modules/contrib/stage_file_proxy/stage_file_proxy.info.yml

If I remove the following line from the yml
core_version_requirement: ^8.7.7 || ^9

than it works again.

Hope this helps.

greggles’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
522 bytes

I had to read https://www.drupal.org/node/3070687 a few times to really get this idea. Check the example that starts with "For example a module that is compatible with Drupal 8 versions after Drupal 8.8.0 and also Drupal 9 will need a info.yml file like this:"

We should remove `core:` because then the module will not install on versions of core prior to 8.7.7. That seems like a good thing.

Status: Needs review » Needs work

The last submitted patch, 9: 3085394-no-core-prevent-old-drupal-installing.patch, failed testing. View results

saschaeggi’s picture

Status: Needs work » Reviewed & tested by the community

Patch from #9 works like a charm for me

  • greggles committed bc39aa2 on 8.x-1.x
    Issue #3085394 by greggles, saschaeggi: 'core_version_requirement' issue...
greggles’s picture

Status: Reviewed & tested by the community » Fixed

Cool - thanks for the quick review :)

I guess #3085280: Add a (at least empty) test is kind of important. Even just visiting the admin/modules page might have caught this.

greggles’s picture

Somehow the credit didn't stick.

Status: Fixed » Closed (fixed)

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