Composer install fails on Drupal 11 and Drupal CMS

Created on 28 January 2025, 24 days ago

Problem/Motivation

The recipe in the 2.x version of the module will not install on Drupal 11 / Drupal CMS. This is true of both 2.0@beta and 2.0@dev

There's a similar issue for a different recipe open here: https://www.drupal.org/project/tasks/issues/3473270 πŸ› Won't install on a fresh drupal 11 Active

Steps to reproduce

Run the recommended ddev composer require 'drupal/alerts:^2.0@beta' or ddev composer require 'drupal/alerts:^2.0@dev'

You will get an error like this:

Problem 1
    - Root composer.json requires drupal/alerts ^2.0@beta -> satisfiable by drupal/alerts[2.0.0-beta1].
    - drupal/alerts 2.0.0-beta1 requires drupal/core ~8.0 -> found drupal/core[8.0.0-beta6, ..., 8.9.x-dev] but the package is fixed to 11.1.1 (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.

Proposed resolution

Update the recipe's composer.json to allow installation.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rklawson

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

Merge Requests

Comments & Activities

  • Issue created by @rklawson
  • πŸ‡ΊπŸ‡ΈUnited States rklawson

    I updated the composer.json to add the Drupal 11 core dependency.

    I was able to test this using the fork by adding the alerts fork as a repository to my local root composer.json file:

        "repositories": {
            "alerts": {
                "type": "package",
                "package": {
                    "name": "drupal/alerts",
                    "version": "2.0.x-dev",
                    "type": "drupal-recipe",
                    "source": {
                        "url": "https://git.drupalcode.org/issue/alerts-3502960.git",
                        "type": "git",
                        "reference": "ea7d736f1ffa995bc29dcdf975e92db20cf8498b"
                    }
                }
            },
            "drupal": {
                "type": "composer",
                "url": "https://packages.drupal.org/8"
            }
        },
    

    Running ddev composer require 'drupal/alerts:2.0.x-dev' did not produce any errors and produced the following results instead:

    ./composer.json has been updated
    Running composer update drupal/alerts
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 1 install, 0 updates, 0 removals
      - Locking drupal/alerts (2.0.x-dev ea7d736)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
      - Syncing drupal/alerts (2.0.x-dev ea7d736) into cache
      - Installing drupal/alerts (2.0.x-dev ea7d736): Cloning ea7d736f1f from cache
    Generating optimized autoload files
    59 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    No security vulnerability advisories found.
    

    This solved the issue of not being able to install the recipe via composer.

Production build 0.71.5 2024