The requirement of drupal/captcha in the composer.json file doesn't work

Created on 18 August 2023, 11 months ago
Updated 21 August 2023, 10 months ago

Problem/Motivation

Steps to reproduce

Do an update with composer from the alpha version to the 2.0 version.
Then do a "composer show drupal/recaptcha_v3" and you get this error:

composer show drupal/recaptcha_v3
name     : drupal/recaptcha_v3
descrip. : The reCaptcha V3 module provides integration with Google reCaptcha V3 and CAPTCHA module.
keywords :
versions : * 2.0.0
type     : drupal-module
license  : GNU General Public License v2.0 or later (GPL-2.0-or-later) (OSI approved) https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText
homepage : https://www.drupal.org/project/recaptcha_v3
source   : [git] https://git.drupalcode.org/project/recaptcha_v3.git 2.0.0
dist     : [zip] https://ftp.drupal.org/files/projects/recaptcha_v3-2.0.0.zip 2.0.0
path     : C:\xampp\htdocs\site9\web\modules\contrib\recaptcha_v3
names    : drupal/recaptcha_v3

support
source : https://git.drupalcode.org/project/recaptcha_v3
error : require.drupal/captcha : invalid version constraint (Could not parse version constraint ^2.0': Invalid version string "^2.0'")

requires
drupal/captcha *
drupal/core ^9.5 || ^10

Remark the error of requiring drupal/captcha.
The error is in composer.json. The version string should be "^2.0" and not "^2.0'". There is an apostroph too many.
This error was allready in the alpha version.
In fact, the result is that there is no constraint of any version of captcha. All versions are permitted.

Proposed resolution

There is no difference anymore between 1.1 and 2.0 versions of the captcha module
version 1.11 = 2.01
version 1.12 = 2.03
version 1.13= 2.04 and
version 1.14 = 2.05.

So, the requirements of captcha in this composer.json could be ^1.11 || ^2.01

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium EricVL

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

Comments & Activities

  • Issue created by @EricVL
  • πŸ‡§πŸ‡ͺBelgium EricVL
  • πŸ‡§πŸ‡ͺBelgium EricVL
  • First commit to issue fork.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.0.7 + Environment: PHP 8.2 & MySQL 8
    last update 11 months ago
    1 pass
  • @dench0 opened merge request.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.0.7 + Environment: PHP 8.2 & MySQL 8
    last update 11 months ago
    1 pass
    • 785a5500 committed on 2.0.x
      Issue #3381952 by EricVL: The requirement of drupal/captcha in the...
  • Status changed to Fixed 11 months ago
  • πŸ‡ΊπŸ‡¦Ukraine dench0

    @EricVL
    Thanks for the heads up.

  • Status changed to Needs review 11 months ago
  • πŸ‡§πŸ‡ͺBelgium EricVL

    @dench0
    Thank you for the quick fix but I think many people has still have the version 1.* of captcha running because they had no reason to change to the 2.x version. Narrowing the version capabilities to only 2.x will need to update captcha too and maybe they don't want to because of other reasons (e.g. a module that needs 1.* of captcha).
    Is there a reason that this module should NOT work with 1.* of captcha?
    Greetings

  • Status changed to Fixed 10 months ago
  • πŸ‡ΊπŸ‡¦Ukraine dench0

    @EricVL
    The 2.x version is designed to work with the captcha 2.x version.
    You need to use 8.x-1.x version of the reCAPTCHA V3 for the 8.x-1.x version of the captcha module.

  • Status changed to Needs review 10 months ago
  • πŸ‡§πŸ‡ͺBelgium EricVL

    @densh0
    Thank you for the clear explanation. My confusion was due to the above issue that all versions of captcha could be a dependency of recaptcha v3 See the requirements in the "composer show" command. This is of course wrong. Thank you.
    But what I'm seeing now is that you have released the new 2.0.1 version on the same git version of 2.0.0. See the repository graph.
    A compare between 2.0.1 and 2.0.0 gives nothing at all.
    The fix is done in a later git version but the tag is on the same version as 2.0.0 is.
    Sorry to bother you again but can you fix this?
    Thank you for your patience.

  • Status changed to Fixed 10 months ago
  • πŸ‡ΊπŸ‡¦Ukraine dench0

    oh, sorry, my bad.
    I pushed the tag without previously pulling the changes.
    I created a new release by tagging the correct commit.
    Thanks.

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

Production build 0.69.0 2024