Problem/Motivation

When trying to run composer install users even users who are not directly using Toolbar can no longer run composer install or update because Toolbar is a required module. Even those of us who are on 11.2 and moving to 11.3 can no longer run any updates. This is made more difficult because other releases are no longer available.

Steps to reproduce

  1. Drupal core 11.2-11.4
  2. Module such as gin toolbar and admin toolbar that requires this module
  3. Run composer install (or update) the following error is returned in a pantheon environment.
   - drupal/admin_toolbar 3.6.3 requires drupal/toolbar * -> satisfiable by drupal/core[8.0.0-beta8, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.4.3, 10.0.0-alpha1, ..., 10.6.x-dev, 11.3.x-dev, ..., 11.x-dev], drupal/toolbar[dev-1.x, dev-2.x, 1.x-dev (alias of dev-1.x), 2.0.0, 2.x-dev].
    - drupal/core 11.5.x-dev requires drupal/core-composer-scaffold 11.5.x-dev -> found drupal/core-composer-scaffold[dev-main, 8.8.0-alpha1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.6.x-dev, 11.0.0-alpha1, ..., 11.x-dev, 12.0.0-alpha1, ..., 12.x-dev (alias of dev-main)] but it does not match the constraint.

Comments

anthonyroundtree created an issue. See original summary.

anthonyroundtree’s picture

Title: Toolbar update breaks dependent modules and sites using 11.2 » Toolbar update breaks dependent modules and sites using 11.2-11.4
dydave’s picture

Is there anything we could do in the code of the module to address that?

Maybe something to add in the composer.json file?

Or is this problem rather on the Drupal.org infrastructure side?

Referencing comment here from @cmlara:
#3579778-83: Removed modules should be included as a replace in composer.json
Maybe some documentation will also need to be updated on our side (Release notes, README, Project page).

Thanks!

matthand’s picture

Something to consider is releasing a version 1.0 stable release of this toolbar module that is compatible with Drupal 10 and up to 11.4. Then the composer dependency that infrastructure is adding would actually be able to resolve. I believe that would work to get through the composer install blocker, but then there'd be 2 "toolbar" namespaced modules. That part would need to be thought through and tested.

Truly this is an infrastructure bug since everywhere they detect the "drupal/toolbar" requirement in a module's info.yml file, they automatically add "drupal/toolbar" to the composer.json of that module. Even though "drupal/toolbar" only has the 2.0.0 stable release and is only compatible with 11.5 and 12.

Core maintainers could also fix this using the same Composer "replace" key workaround that they added to Drupal 11.4.x by backporting it to Drupal 10.6.x and 11.3.x. In my opinion that's where the fix should live but it somehow feels unlikely to happen.

damienmckenna’s picture

Am running into this upgrading a site from Drupal 10 to 11.3; FWIW upgrading to 11.4 works ok.

dydave’s picture

I'm wondering something here Matt (@matthand):

Would this issue still occur if we were to change the core version requirements of the 1.x branch ?
Could this issue be occurring because the core version requirements of the 1.x is set to ^11.3 || ^12 ?
https://git.drupalcode.org/project/toolbar/-/blob/1.x/toolbar.info.yml?r...

The branch 1.x is abandoned and unsupported. We could add an extra commit if necessary to change the core version requirements of that branch, so it does not conflict with other branches or releases.

Thanks in advance!