Problem/Motivation

When I try to install the libraries using the composer merge plugin and the file composer.libraries.json, I got an error when composer tries to install the library jquery/icheck.
The error is when trying to download the zip https://github.com/fronteed/icheck/archive/1.0.2.zip:

the given path has multiple possibilities: #<Git::Ref:0x00007fe6828d4580>, #<Git::Ref:0x00007fe6828dbfd8>

I think it is because there is a branch called 1.0.2 and also a tag with the same name.

Steps to reproduce

Add the webform libraries following the documentation on https://www.drupal.org/docs/8/modules/webform/webform-frequently-asked-q...

After the composer update --lock command to download the libraries it will fail.

Proposed resolution

Avoid the ambiguity on the url, and replace https://github.com/fronteed/icheck/archive/1.0.2.zip to https://github.com/dargullin/icheck/archive/refs/tags/1.0.2.zip

Issue fork webform-3264249

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Eduardo Morales Alberti’s picture

Issue summary: View changes
Eduardo Morales Alberti’s picture

Issue summary: View changes
andrewbelcher’s picture

Priority: Normal » Critical
Status: Active » Needs review
FileSize
527 bytes
527 bytes
543 bytes

So it looks like the upstream repo has been moved and that has introduced the conflicting branch names and therefore these problems.

Unfortunately this breaks every build that doesn't already have the cached version already downloaded, so bumping this to critical.

However, it can also be easily fixed by providing the new URL, though I would recommend being more explicit with https://github.com/dargullin/icheck/archive/refs/tags/1.0.2.zip.

Patches for 6.0.x, 6.1.x and 6.2.x attached (though the only difference is line numbers, so probably doesn't need separate patches).

nishantghetiya’s picture

Assigned: Unassigned » nishantghetiya
Status: Needs review » Reviewed & tested by the community
FileSize
170.05 KB

This issues is resolved after applying above patch.
Thanks

Luke.Leber’s picture

MR 144 looks good to me, +1 RTBC.

Seems like a good idea to open a follow-up to re-evaluate the other repositories as well.

jcnventura’s picture

An alternative way to solve this is to have the developer of icheck fix it on his side: https://github.com/dargullin/icheck/issues/437

I've contacted him with a Twitter DM asking him to delete the 1.0.2 and 1.0.3 branches that cause this ambiguity.

Luke.Leber’s picture

FWIW - We've temporarily fixed this by adding an updated repository to our root composer.json file. A repo set up in the root composer.json should take precedence over any added by the composer merge plugin.

jcnventura’s picture

jrockowitz’s picture

Status: Reviewed & tested by the community » Needs work

All instances of https://github.com/fronteed/icheck/archive/1.0.2.zip need to be updated.

@see webform_icheck_webform_libraries_info()

  • andrewbelcher authored 3f412d3 on 6.0.x
    Issue #3264249 by andrewbelcher, Eduardo Morales Alberti, nishantghetiya...

  • andrewbelcher authored 54b0d2a on 6.1.x
    Issue #3264249 by andrewbelcher, Eduardo Morales Alberti, nishantghetiya...
jrockowitz’s picture

Status: Needs work » Fixed

  • andrewbelcher authored 54b0d2a on 6.x
    Issue #3264249 by andrewbelcher, Eduardo Morales Alberti, nishantghetiya...

  • andrewbelcher authored 54b0d2a on 6.2.x
    Issue #3264249 by andrewbelcher, Eduardo Morales Alberti, nishantghetiya...
jcnventura’s picture

Thanks @jrockowitz, can you please tag new versions of the modules to fix this problem for good?

jwilson3’s picture

#17 +1

fengtan’s picture

The new releases are out:

Updating from webform 6.1.2 to 6.1.3 fixes the problem for us.

Thanks for resolving this so quickly.

jwilson3’s picture

🎉

alfattal’s picture

Status: Fixed » Needs work

The same issue on Drupal core 9.2.11 try to update to Drupal core 9.2.13 even after updating webforms to the latest version (6.1.3). So far, none of the suggested fixes in related issue seems to solve the problem.

cilefen’s picture

@alfattal Please walk us through how to reproduce this. What is the error output?

jrockowitz’s picture

My best guess is that people are not using composer.libraries.json and have the old iCheck URL in their composer.json file.

To fix this developers will need replace https://github.com/fronteed/icheck/archive/1.0.2.zip with https://github.com/dargullin/icheck/archive/refs/tags/1.0.2.zip

sheanhoxie’s picture

I am using composer.libraries.json and was having trouble going from 6.1.2 to 6.1.3.

This is the process that worked for me:

  • delete modules/contrib/webform folder
  • composer clear-cache
  • composer update drupal/webform --with-dependencies

Not sure if the --with-dependencies was necessary but I threw it in for good measure and everything updated smoothly after that and resolved the error of downloading jquery/icheck

alfattal’s picture

Status: Needs work » Fixed

@jrockowitz It finally worked after manually changing the download URL for the iCheck plugin in composer.lock file. For some reason, running the command composer update --lock updated everything except that URL. Marking as Fixed, thanks everyone!

Status: Fixed » Closed (fixed)

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