Update Drupal core requirement - version constraint >=^8: Invalid version string "^8"

Created on 31 January 2024, 12 months ago

Problem/Motivation

After enabling the module on Drupal 10 the following error message is displayed: UnexpectedValueException: Could not parse version constraint >=^8: Invalid version string "^8" in Composer\Semver\VersionParser->parseConstraint() (line 521 of /srv/dev-exim/vendor/composer/semver/src/VersionParser.php).

Steps to reproduce

On a Drupal 10 site run composer require 'drupal/usajobs:^2.0' then run drush en usajobs

Proposed resolution

update core_version_requirement: in usajobs.info.yml from core_version_requirement: '>=^8'8 to core_version_requirement: ^8 || ^9 || ^10

update "drupal/core": in composer.json from "drupal/core": '>=^8' to "drupal/core": "^8 || ^9 || ^10"

Remaining tasks

none

User interface changes

none

API changes

none

Data model changes

none

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ericrubino Washington DC

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

Merge Requests

Comments & Activities

  • Issue created by @ericrubino
  • First commit to issue fork.
  • Merge request !1Update version constraint β†’ (Merged) created by phoang
  • πŸ‡ΊπŸ‡ΈUnited States phoang
  • Status changed to Fixed 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States phoang
  • πŸ‡ΊπŸ‡ΈUnited States phoang

    @ericrubino Thanks for catching the issue.

  • πŸ‡ΊπŸ‡ΈUnited States ericrubino Washington DC
  • πŸ‡ΊπŸ‡ΈUnited States ericrubino Washington DC

    Changed two files: composer.json and usajobs.info.yml.

    In the composer.json file, the requirement for the drupal/core package is being changed. Originally, the requirement was for any version of Drupal 8 or higher (">=^8"). The updated requirement is for any version of Drupal 8, 9, or 10 ("^8 || ^9 || ^10"). This means the code is compatible with these specific major versions of Drupal.

    In the usajobs.info.yml file, a similar change is being made to the core_version_requirement. Originally, the module could run on any version of Drupal 8 or higher. The updated requirement is for any version of Drupal 8, 9, or 10.

Production build 0.71.5 2024