Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Status report:
The version of the Colorbox plugin library could not be detected. You need to download the Colorbox plugin, extract the archive and place the colorbox directory in the sites/all/libraries directory on your server.
Problem:
Regex of colorbox_libraries_info()
patern.
Workaround:
Replace 'pattern' => '@(?i:Colorbox) v([0-9\.a-z]+)@',
with 'pattern' => '@(?i:Colorbox)[ |v]([0-9\.a-z]+)@',
.
Below is the patch.
Comment | File | Size | Author |
---|---|---|---|
#5 | Colorbox_plugin_not_detected-2336341-5.patch | 498 bytes | ItangSanjana |
Comments
Comment #1
ItangSanjana CreditAttribution: ItangSanjana commentedComment #2
ItangSanjana CreditAttribution: ItangSanjana commentedComment #3
cfox612 CreditAttribution: cfox612 commentedTested and works. Keeping status as is until someone else verifies.
Comment #4
mxhWorks for me as well.
Comment #5
ItangSanjana CreditAttribution: ItangSanjana commentedHere is the proper regex (with or without the "v") before the plugin's version. Sorry was in a hurry :(
E.g. for
Colorbox v1.5.14
orColorbox 1.5.14
Comment #6
JGReidy CreditAttribution: JGReidy commentedPatch worked for me.
drush .make file:
projects[colorbox][version] = "2.7"
projects[colorbox][patch][] = "http://www.drupal.org/files/issues/Colorbox_plugin_not_detected-2336341-..."
libraries[colorbox][download][type] = "get"
libraries[colorbox][download][url] = "https://github.com/jackmoore/colorbox/archive/master.zip"
libraries[colorbox][destination] = "libraries"
libraries[colorbox][directory_name] = "colorbox"
Comment #7
clemens.tolboomShouldn't this be reported upstream too?
I fixed this by editing
sites/all/libraries$ vi colorbox/jquery.colorbox-min.js
adding a vPatch looks OK to me too.
Comment #8
frjo CreditAttribution: frjo commentedComment #10
frjo CreditAttribution: frjo commentedI have committed a slightly different update to the regex to 7.x-2.x:
'@(?i:Colorbox)\sv?([0-9\.a-z]+)@'
Will make a new release during the weekend.
Comment #11
ItangSanjana CreditAttribution: ItangSanjana commented#9 tested and works. Nice regex :)
Comment #12
ItangSanjana CreditAttribution: ItangSanjana commentedComment #13
jackmoore CreditAttribution: jackmoore commentedFredrik, my apologies for breaking things. I would not have guessed the comment block was depended on by anyone. There is a colorbox.jquery.json file included in the download that is used by the jQuery plugins repository and contains information such as the version number. I'm not sure what limitations you have to deal with, but getting the version property value from a json object would be more dependable than a regex. I can add, and probably will add, a package.json file for NPM that contains similar info.
Comment #14
frjo CreditAttribution: frjo commentedNice to see you here on d.o. Jack! No problem on the version number change, it was an easy fix.
Drupals library api don't support reading json as of now so a regex would be needed there anyway and not all users would bother adding more than the essential js files to their Drupal installs.
P.S. The Colorbox module has 200000+ live installs now :-)!
Comment #15
mxh#9 works for me as well.