Problem/Motivation

Right now Admin Toolbar prevents us upgrading to Drupal ^9.1. That happens because modules core requirements are ^8.8.0 || ^9.0.
Is there any known reasons for keeping compatibility with 9.0 only?
This affects both 2.x and 3.x.

Proposed resolution

Change core requirements to ^8.8.0 || ^9.
See also https://www.drupal.org/project/admin_toolbar/issues/3094517#comment-1362...

CommentFileSizeAuthor
#7 3209960-7.patch422 bytespaulocs
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

luuph created an issue. See original summary.

romainj’s picture

Version: 8.x-2.x-dev » 3.x-dev
romainj’s picture

Version: 3.x-dev » 8.x-2.x-dev
romainj’s picture

Status: Active » Fixed
nick hope’s picture

3.0.0 installed fine for me on Drupal 9.1.7. But if someone really cannot install Admin Toolbar in 9.1 because the core requirement is core_version_requirement: ^8.8.0 || ^9.0 then it seems to me that in theory that person would not be able to install it in Drupal 8.9 either.

So maybe it would make more sense to change the requirement to core_version_requirement: ^8.8 || ^9. That is extremely common in other modules. The vast majority have either that or just core_version_requirement: ^8 || ^9.

paulocs’s picture

Version: 8.x-2.x-dev » 3.x-dev
Status: Fixed » Needs review
StatusFileSize
new422 bytes

Actually this was fixed only in 8.x-2.x branch.
Here is a patch for 3.x. I'm not sure how it works to create merge request for another branch and track it in the same issue. I think it is necessary to create another issue, so it is easier to create patch and commit it here.

I'm reopening the issue.

  • adriancid committed 02f57c7 on 3.x authored by paulocs
    Issue #3209960 by luuph, paulocs, romainj, Nick Hope, adriancid: Admin...
adriancid’s picture

Status: Needs review » Fixed

Thanks

luuph’s picture

@Nick Hope

3.0.0 installed fine for me on Drupal 9.1.7. But if someone really cannot install Admin Toolbar in 9.1 because the core requirement is core_version_requirement: ^8.8.0 || ^9.0 then it seems to me that in theory that person would not be able to install it in Drupal 8.9 either.

Tbh, I didn't test the use case of installing admin_toolbar on Drupal 9.1. My issue arose when I tried to update Drupal from 9.0.* to 9.1.*, but composer.json of admin_toolbar only allowed me to get latest 9.0, but not 9.1.

nick hope’s picture

So by that theory, might core_version_requirement: ^8.8.0 || ^9 prevent Composer updating Drupal to 8.9 from an earlier version?

It still seems to me that the .0 is unnecessary, and unusual.

Status: Fixed » Closed (fixed)

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

mmjvb’s picture

Running admin_toolbar 2.4.0 with core ^8.8.0 || ^9.0 in composer.json on D9.1.7.
As it was an upgraded site, removed and installed it again. No problem.

The core_version_requirement effects install in Drupal. Composer uses composer.json, possibly effected by core_version_requirement. My understanding is that only when there is no composer.json the facade produces one based on the info.yml.

Don't know about what Drupal does with ^8.8.0 || ^9.0, but Composer treats it as staying within 8 or 9. Obviously, starting from 8.8.
So, there was no need to change it. Agree with ^8.8 || ^9.1 being more meaningful. No need for adding .0 with 8.8, recommend against ^9.0 as that is the first minor in 9.

PS Also running 2.4.0 on 8.9.14. Also removed and installed it again: No problem!

gapple’s picture

Version constraint behaviour should be identical between packages in composer.json, and Drupal's core_version_requirement.

The caret operator allows any non-major release update (https://getcomposer.org/doc/articles/versions.md#caret-version-range-)
- ^9.0 and ^9 are both equivalent to >=9.0.0 <10.0.0
- ^9.1 is equivalent to >=9.1.0 <10.0.0

If used, the tilde operator would only allows updates to the least significant provided version number, which could restrict minor version updates
- ~9.0 is equivalent to >=9.0.0 <10.0.0
- ~9.0.0 is equivalent to >=9.0.0 <9.1.0