Problem/Motivation
The module cannot be installed on Drupal 9+ sites using current 6.0.x branch due to a strict version constraint in composer.json that locks drupal/js_cookie to exactly version 1.0.0, which only supports Drupal 8.
This is a regression introduced in: https://www.drupal.org/project/modal_page/issues/3552794
Steps to reproduce
Install D9+ and try to require modal_page on 6.0.x. I tried with D11, but from the output it's clear that any Drupal version from 9 will fail.
$ composer create-project drupal/recommended-project:^11 d11_test
...INSTALLING D11 PROJECT...
$ cd d11_test
$ composer require drupal/modal_page:dev-6.0.x
./composer.json has been updated
Running composer update drupal/modal_page
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires drupal/modal_page dev-6.0.x -> satisfiable by drupal/modal_page[dev-6.0.x].
- drupal/js_cookie 1.0.0 requires drupal/core ~8.0 -> found drupal/core[8.0.0, ..., 8.9.20] but the package is fixed to 11.2.7 (lock file version) by a partial update and that
version does not match. Make sure you list it as an argument for the update command.
- drupal/modal_page dev-6.0.x requires drupal/js_cookie 1.0 -> satisfiable by drupal/js_cookie[1.0.0].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Proposed resolution
Use semantic versioning constraint "^1.0" instead of strict "1.0" for the drupal/js_cookie dependency.
Remaining tasks
Change the version constraint in composer.json from "drupal/js_cookie": "1.0" to "^1.0" to allow composer to use version 1.0.2, which supports Drupal 9, 10, and 11.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Issue fork modal_page-3556769
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
Comment #3
keszthelyi commentedComment #4
renatog commentedNice catch!
I verified that when testing #3552794: core/js-cookie removed from Drupal 11
Commited at https://git.drupalcode.org/project/modal_page/-/commit/4b797daa67ff7a9aa...
Thanks @keszthelyi
Comment #6
renatog commentedComment #7
renatog commented