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.
- Tag 1.0.2: https://github.com/dargullin/icheck/releases/tag/1.0.2
- Branch 1.0.2: https://github.com/dargullin/icheck/tree/1.0.2
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
Comment | File | Size | Author |
---|---|---|---|
#6 | Screenshot 2022-02-14 at 7.17.35 PM.png | 170.05 KB | nishantghetiya |
Issue fork webform-3264249
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
Comment #2
Eduardo Morales AlbertiComment #3
Eduardo Morales AlbertiComment #4
andrewbelcher CreditAttribution: andrewbelcher at FreelyGive for Access commentedSo 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).
Comment #6
nishantghetiya CreditAttribution: nishantghetiya as a volunteer and at QED42 for Drupal India Association commentedThis issues is resolved after applying above patch.
Thanks
Comment #7
Luke.LeberMR 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.
Comment #8
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedAn 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.
Comment #9
Luke.LeberFWIW - 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.
Comment #10
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedI've created the follow-up: #3264301: Evaluate all the URLs in the composer.libraries.json
Comment #11
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedAll instances of https://github.com/fronteed/icheck/archive/1.0.2.zip need to be updated.
@see webform_icheck_webform_libraries_info()
Comment #14
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #17
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedThanks @jrockowitz, can you please tag new versions of the modules to fix this problem for good?
Comment #18
jwilson3#17 +1
Comment #19
fengtanThe 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.
Comment #20
jwilson3🎉
Comment #21
alfattal CreditAttribution: alfattal as a volunteer commentedThe 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.
Comment #22
cilefen CreditAttribution: cilefen commented@alfattal Please walk us through how to reproduce this. What is the error output?
Comment #23
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedMy 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
Comment #24
sheanhoxieI 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:
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
Comment #25
alfattal CreditAttribution: alfattal as a volunteer commented@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!