install version 3.1.2 instead of 3.0

Created on 3 June 2023, about 1 year ago
Updated 22 January 2024, 5 months ago

Problem/Motivation

I'm upgrading my sites from version 8 to version 9 of Drupal; while upgrading modules to versions compatible with version 8 and version 9; Found only version 3.0 compatible with both versions 8 and 9.
But when I try to install it, it installs the latest version (3.1.2), which is not compatible with Drupal 8.
composer require 'drupal/permissions_by_term:^3.0'

πŸ› Bug report
Status

Closed: works as designed

Version

3.0

Component

Miscellaneous

Created by

πŸ‡§πŸ‡­Bahrain drattar

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

Comments & Activities

  • Issue created by @drattar
  • πŸ‡ΊπŸ‡¦Ukraine kuflievskiy

    Hi everyone!

    I think this issue could be considered as a composer version constraint question.

    Caret's "^" symbol allows the version to go up as expected.

    When you see a caret constraint like ^3.0, it signifies that Composer is allowed to install any version of the package that is compatible with the specified version, but not including the next major version. The caret constraint follows the Semantic Versioning (SemVer) rules.

    For example:

    3.0.0 is allowed.
    3.1.0 is allowed.
    3.1.5 is allowed.
    3.2.0 is allowed.
    4.0.0 is not allowed.

    https://getcomposer.org/doc/articles/versions.md#caret-version-range-

    As a solution to the initial question (to support both Drupal 8 and Drupal 9), it's possible to use "~3.0" notation.
    composer require 'drupal/permissions_by_term:~3.0'

    With the tilde (~) operator, Composer will allow any version equal to or greater than 3.0.0 and less than 3.1.0. This indicates that only the minor version can vary within the 3.0 major version.

    Here are some examples of what versions would be allowed:

    3.0.0 is allowed.
    3.0.1 is allowed.
    3.0.5 is allowed.
    3.1.0 is not allowed.

    I suggest also closing this issue.

  • Status changed to Closed: works as designed 5 months ago
  • πŸ‡©πŸ‡ͺGermany marcoliver Neuss, NRW, Germany

    I agree with @kufliievskyi. This seems to be solely an issue with the version constrained used to require the module into the project. Closing.

Production build 0.69.0 2024