Update composer.json to allow for Drupal 11

Created on 22 December 2024, 18 days ago

Problem/Motivation

In https://www.drupal.org/project/layout_builder_iframe_modal/issues/3431586 πŸ“Œ Automated Drupal 11 compatibility fixes for layout_builder_iframe_modal Needs review , (https://git.drupalcode.org/project/layout_builder_iframe_modal/-/merge_r...), Drupal 11 compatibility was added to the module's info file but I am unable to use the module with Drupal 11.1 as the module's composer.json file does not account for Drupal 11. Running composer require 'drupal/layout_builder_iframe_modal:^1.3' results in

 Problem 1
    - Root composer.json requires drupal/layout_builder_iframe_modal ^1.3 -> satisfiable by drupal/layout_builder_iframe_modal[1.3.0, 1.3.1, 1.3.2, 1.3.x-dev].
    - drupal/layout_builder_iframe_modal[1.3.0, ..., 1.3.x-dev] require drupal/core ^8.8.0 || ^9.0 || ^10 -> found drupal/core[8.8.0-alpha1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.5.x-dev] but the package is fixed to 11.1.0 (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.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

If I use the -W flag, I get:

Problem 1
    - Root composer.json requires drupal/layout_builder_iframe_modal ^1.3 -> satisfiable by drupal/layout_builder_iframe_modal[1.3.0, 1.3.1, 1.3.2, 1.3.x-dev].
    - drupal/layout_builder_iframe_modal[1.3.0, ..., 1.3.x-dev] require drupal/core ^8.8.0 || ^9.0 || ^10 -> found drupal/core[8.8.0-alpha1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.5.x-dev] but these were not loaded, likely because it conflicts with another require.

Steps to reproduce

  1. Setup a basic Drupal 11.1 site
  2. Enable Layout Builder
  3. Try to add layout_builder_iframe_modal via composer composer require 'drupal/layout_builder_iframe_modal:^1.3'
  4. You should now get the error message as per above

Proposed resolution

in the module's composer.json file, either remove the code below all together (I have seen some modules not have this)

"require": {
    "drupal/core": "^8.8.0 || ^9.0 || ^10"
}

... or update it to be:

"require": {
    "drupal/core": "^10 || ^11"
}

Remaining tasks

I can start an issue fork and we can go from there. At least that will allow usage for D11 until the maintainers decide which way to go.

πŸ“Œ Task
Status

Active

Version

1.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Danny Englander San Diego

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024