As a followup to #3101941: Add composer.json for compatibility with Drupal 9 automated testing, for Drupal 9 compatibility, this module will also need the core_version_requirement defined.

See https://www.drupal.org/project/project_composer/issues/3084063#comment-1... :

Note: I seem to have a case where the workaround of adding it manually to composer.json doesn't seem to work for testbot

and https://www.drupal.org/node/3070687#comment-13418093

Indicating that the composer.json file is no longer necessary..., and finally, in https://www.drupal.org/project/project_composer/issues/3084063#comment-1...

It will set the drupal/core version to any version requirement set by a dependency on a core module from the .info.yml files, like it does now.

If core_version_requirement is set, that will take precedence over what is in the .info.yml dependencies section.

If drupal/core is listed as a dependency in the composer.json, that value will take utmost precedence.

For the Mini Layouts project, in the near-term, only having the core_version_requirement in the .info.yml file should be sufficient, since there is no need for a composer.json to specify other constraints.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mark_fullmer created an issue. See original summary.

mark_fullmer’s picture

Assigned: mark_fullmer » Unassigned
Status: Active » Needs review
FileSize
370 bytes
767 bytes

The attached patches provide a version that just adds the core_version_requirement to the .info.yml, and one that additionally removes the composer.json (as stated above, it's not technically necessary).

  • rlmumford committed c0cc3ab on 8.x-1.x authored by mark_fullmer
    Issue #3114958 by mark_fullmer: Add core_version_requirement for Drupal...
rlmumford’s picture

Status: Needs review » Fixed

Decided to get rid of composer.json - less to maintain. Thanks for helping me stay up to date on this.

mark_fullmer’s picture

Status: Fixed » Needs review
FileSize
408 bytes

Sorry to re-open this! I only discovered a constraint on the core_version_requirement until after running tests on the Drupal 9.0 branch:

Drupal\Core\Extension\InfoParserException: The 'core_version_requirement' can not be used to specify compatibility for a specific version before 8.7.7 in modules/contrib/mini_layouts/mini_layouts.info.yml

See background at #3077942: If 'core_version_requirement' specifies compatibility with all versions of Drupal 8 like '^8' the 'core: 8.x' must also be set.

So, we need to bump the minimum version. Patch attached that specifies ^8.8 as the minimum Drupal 8 version (^8.7 should work, per semantic versioning, too, if you feel it is valuable to allow sites running 8.7 right now to newly install this module, rlmumford).

  • rlmumford committed c7590d7 on 8.x-1.x authored by mark_fullmer
    Issue #3114958 by mark_fullmer, rlmumford: Add core_version_requirement...
rlmumford’s picture

Status: Needs review » Fixed

I've pushed another commit - with ^8.7. I'm a bit concerned that I needed to put ^8.7.7.

Do I need to roll a release?

mark_fullmer’s picture

A new release is not required for modules that require this module in their testing suites to work -- they will grab the latest 8.x-1.x commit.

Let's see what Layout Builder Restrictions' 9.0 test run does this time around, and if it gives the thumbs up on Mini Layouts' 9.0 compatibility, you could consider cutting a release that represents that the module is (currently) 9.x compatible, and add a badge about it on the project page (see https://www.drupal.org/project/drupalorg/issues/3046058).

Christopher Riley’s picture

I am using version 10 of drush do I need to apply this patch or not as I am getting:

The 'core_version_requirement' can not be used to specify compatibility for a specific version before 8.7.7 in modules/contrib/mini_layouts/mini_layouts.info.yml

when I do a drush updb

Thanks,

  • rlmumford committed 35c587a on 8.x-1.x authored by mark_fullmer
    Issue #3114958 by mark_fullmer, rlmumford: Add core_version_requirement...
rlmumford’s picture

@Christopher-Riley I've committed a fix. Can you test now?

Christopher Riley’s picture

Pulled the latest dev and still get:

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

If I remove the line I can do the drush updb and the site loads otherwise no joy.

mark_fullmer’s picture

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

That's progress! Now this module just needs to remove the core parameter: https://git.drupalcode.org/project/mini_layouts/blob/8.x-1.x/mini_layout...

mark_fullmer’s picture

  • rlmumford committed 90f9c61 on 8.x-1.x
    Issue #3114958 by mark_fullmer, rlmumford: Add core_version_requirement...
rlmumford’s picture

Try now?

Christopher Riley’s picture

I do believe we are in business thanks for looking into this.

Status: Fixed » Closed (fixed)

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