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

Command icon 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

keszthelyi created an issue. See original summary.

keszthelyi’s picture

Assigned: keszthelyi » Unassigned
Status: Active » Needs review
renatog’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

renatog’s picture

renatog’s picture

Title: Strict version constraint on drupal/js_cookie prevents installation on Drupal 9+ » Strict version constraint on drupal/js_cookie prevents installation on D9+

Status: Fixed » Closed (fixed)

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