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.
Hi,
In spite of downloading the latest plugin & placing it where it's recommended & the plugin, I keep getting this error message:
Warning: file_get_contents(sites/all/libraries/colorbox/colorbox/jquery.colorbox-min.js) [function.file-get-contents]: failed to open stream: No such file or directory in colorbox_get_version() (line 299 of /home/woof/public_html/sites/all/modules/colorbox/colorbox.module).
I have checked & that js file is there & in fact tried changing permissions to almost 777.
Error
Colorbox plugin At least 1.3.6
You need to download the Colorbox plugin and extract the entire contents of the archive into the sites/all/libraries folder of your server.
1.3.16 is what s available & it is in that library.
All folders are readable & writable.
So what could be the problem?
Regards.
Comment | File | Size | Author |
---|---|---|---|
#24 | 1116672-colorbox-version-pattern-fix-1.patch | 425 bytes | acbramley |
Comments
Comment #1
lionheart8 CreditAttribution: lionheart8 commented;)
Problem found, .... I had named the folder "library" & not "libraries"
Comment #2
frjo CreditAttribution: frjo commentedComment #3
lgb2001 CreditAttribution: lgb2001 commentedI'm having the same problem. I've double checked the spelling of my "libraries" folder; I've checked permissions on the folder (and sub-folders) without any change in the error message. Not sure what to try next...
Comment #4
frjo CreditAttribution: frjo commentedLoad this in your browser (replace "domain.tld" with your actual domain):
domain.tld/sites/all/libraries/colorbox/colorbox/jquery.colorbox-min.js
Does the file load?
Comment #5
toulon CreditAttribution: toulon commentedOh and don't forget to copy the jquery files to libraries
$ cp jquery.colorbox* sites/all/libraries/colorbox/colorbox/
Don't even start up about the colorbox/colorbox folders. It is a colorbox thing.
Comment #6
asb CreditAttribution: asb commentedSimilar issue, the colorbox libraries couldn't be accessed. I had to set ugly permissions to get it working:
chown -R www-data:www-data sites/all/libraries/colorbox/
I don't know if this is safe.
Comment #7
frjo CreditAttribution: frjo commentedThe web server must be able to read the Colorbox plugin files. Just set the same permission that all the other Drupal files has.
Comment #8
js CreditAttribution: js commentedI am getting the colorbox error on /reports/status
I can load the script directly as in #4
When I save in
admin/config/media/colorbox
there is not an error with the default settting
sites/all/libraries/colorbox
and there is if I change it.
Comment #9
asb CreditAttribution: asb commented@frjo (#7): Imho the "normal" Drupal file permissions do not suffice to let Drupal access
./sites/all/libraries/colorbox
- at least that's when I get the missing plugin error in Debian "Lenny": "You need to download the Colorbox plugin and extract the entire contents of the archive into the sites/all/libraries/colorbox folder of your server".Permissions insufficient:
Permissions sufficient:
On my sites, most of the files and directories from Drupal core are owned by root (or any other privileged sudoers user able to write into /var/www); these permissions are working fine. Exceptions are
./sites/default/files
and several libraries in./sites/all/libraries
. Some time ago we had to set up Drupal on FreeBSD, where we were required too let the webserver user own all files and directories; we learned that this configuration was not safe since any webserver process was able to trash all Drupal files.However, I'm no expert on Linux file system permissions, so I'm always open for best practice advice ;)
Comment #10
frjo CreditAttribution: frjo commented@asb, I run Debian 5 Lenny on most of my servers and have had no problems with file permissions regarding sites/all/libraries/colorbox. I use 755 (drwxr-xr-x) for directories and 644 (-rw-r--r--) for files. The owner and group is normally a standard user, not root or the apache user (www-data).
Comment #11
frjo CreditAttribution: frjo commentedI warmly recommend that you all use Drush to install the plugin. Quick and easy and it will make sure everything is placed it the correct way.
$ drush colorbox-plugin
http://drupal.org/project/drush
Comment #12
asb CreditAttribution: asb commentedYeah, the drush command is pretty cool ;)
I think this issue can be closed since it has all information to get 'colorbox' running. Please reopen if problem persists.
Comment #14
DavidMichael2222 CreditAttribution: DavidMichael2222 commentedI was not able to get the files in the correct folders until after the third or fourth try. This is what worked for me. Maybe it will help some other confused soul:
In the sites/all/libraries folder make a new folder “colorbox
Folders in this sites/all/libraries/colorbox folder should be:
colorbox
content
example1 through example5
Files in this sites/all/libraries/colorbox folder should be:
colorbox.ai
readme.md
Files in this sites/all/libraries/colorbox/colorbox folder should be:
jquery.colorbox-min.js
jquery.colorbox.js
It looks like the permissions for the two .js files should be 755.
If this is wrong or dangerous, please post a comment, but it does work.
Thanks.
Comment #15
koshi CreditAttribution: koshi commentedFor those who use beta version. It has a bug and it does not work with the latest version of ColorBox (v1.3.29). You should edit jquery.colorbox-min.js and place a ColorBox version info on a first line. As an alternative you can patch function colorbox_libraries_info() in the colorbox.module:
85c85
< 'lines' => 1,
---
> 'lines' => 5,
Comment #16
BenWrighton CreditAttribution: BenWrighton commentedI have this error msg too (Drupal 7, Colorbox 7.x-1.5, Color box file permissions all 777)
But Colorbox is working fine on the site as far as I can see (all files accessable, no 404s) so I'm assuming it's a rogue error msg.
Comment #17
grobe CreditAttribution: grobe commentedWhen I download the plugin using wget and unzip the file using unzip on my Debian system, the two files are put into colorbox, not colorbox/colorbox. Creating a subdirectory "colorbox" in the plugin-directory of the same name solved the problem. The issue may be related to the zip-format for a lot of users experiencing it on Linux systems.
Cheers, Lars.
Comment #18
corbin CreditAttribution: corbin commentedi get the message with a fresh install of commerce_kickstart-7.x-2.6
colorbox/colorbox is in profiles/commerce_kickstart/libraries (not in sites/all/libraries : it's commerce kickstart !)
i tried chmod 777 on files and folders
#15 is ok
i tried #14
i'm going to see if it works as #16
Comment #19
dolly nyc CreditAttribution: dolly nyc commented@corbin - you don't have the plugin in the correct folder that is why it isn't working. It needs to be in sites/all/libraries as per the installation instructions: http://drupalcode.org/project/colorbox.git/blob/refs/heads/7.x-2.x:/READ...
Comment #20
greenmother CreditAttribution: greenmother commentedif you have this problem with last colorbox version - try to edit jquery.colorbox-min.js and change "Colorbox" to "ColorBox" in comment with version description at row 2
update: better use dev version, it works fine for now.
Comment #21
corbin CreditAttribution: corbin commented@dolly nyc
i don't think so : kickstart is a drupal commerce package whose structure is different and colorbox is already integrated in it :
modules of this package are in this structure, but when you add new modules, they have to be in the classical sites/all/modules/
that's why i precised
anyway, at this moment, it doesn't seem there is any trouble, only this message .
Comment #22
frjo CreditAttribution: frjo commentedThe Libraries module have no problem to find the Colorbox plugin in an active profiles libraries folder.
The problem with Commerce Kickstart is that it comes installed with a late version of the Colorbox plugin but not the latest version of the Colorbox module. Update the Colorbox module to 7.x-2.4 and the problem will go away.
And please don't reopen old closed issues, create a new one instead.
Comment #23
acbramley CreditAttribution: acbramley commented@frjo I just update colorbox from 7.x-1.3 to 7.x-1.5 and this issue definitely still exists. I even used the drush command to download the library and still get the message (although colorbox works fine). I think dismissing @corbin and saying upgrade to 7.x-2.4 is a bit abrupt. Firstly, from my point of view as a developer, going from 1.x to 2.x on any module is a major jump and some people just don't want to do that. There's no documentation anywhere I can see of an upgrade path, or even just some helpful text like "hey upgrading won't break your stuff". If you are still offering the 1.x branch as a release, then this needs to work and not report incorrect problems, otherwise remove it and add some upgrade documentation (this should be done anyway).
Comment #24
acbramley CreditAttribution: acbramley commentedThe issue is with the regex pattern used to check the version. Colorbox plugin uses the version string "jQuery Colorbox v1.4.14 - 2" which does not match '#ColorBox v([0-9\.a-z]+)#'
This patch fixes the issue.
Comment #25
frjo CreditAttribution: frjo commentedBackported the fix from 7.x-2.x branch, committed to 7.x-1.x.
The release notes for 7.x-2.0 has information about the changes. If you don't need the form support and don't mind installing the libraries module there are no problems upgrading to 7.x-2.x.
Comment #27
corbin CreditAttribution: corbin commented@acbramley
sorry, but :
?
Comment #28
acbramley CreditAttribution: acbramley commented@corbin yes? That is indeed the fix. A slightly modified version was committed but it's the same idea.
Comment #29
tmsimont CreditAttribution: tmsimont commentedI am having this same issue. Since colorbox works on its own, this is Commerce Kickstart problem.
Comment #30
acbramley CreditAttribution: acbramley commented@tmsimont have you tried the patch, or the latest dev release of the branch you're on? If you open a closed issue please provide more detail as to how to reproduce your bug, whether it's reproducable with the patch, etc.
Also this issue was with Colorbox, please read the previous comments.
Comment #31
acbramley CreditAttribution: acbramley commentedComment #32
frjo CreditAttribution: frjo commentedPlease don't reopen old issues, create a new one instead.
Comment #33
dargente CreditAttribution: dargente commentedStill had errors of Drupal not finding plugin after updating to latest Colorbox Module, and latest Colorbox Plugin --> correctly placed in sites/libraries folder.
For those still having issues, Drush command "drush colorbox-plugin" works! Don't forget to "apt-get install unzip" so the plugin extracts correctly.
Comment #34
davidwhthomas CreditAttribution: davidwhthomas commentedStill getting this error in latest colorbox module v(7.x-2.5) and latest colorbox library downloaded (v1.4.36)
For others looking for a solution to remove the erroneous error message, and you know the colorbox version is ok, you can remove the requirements check in a custom module with this hook.
Comment #35
scott.whittaker CreditAttribution: scott.whittaker commentedColorbox is not working for me since updating Commerce Kickstart from 7.x-2.17 to 7.x-2.19. Used the drush command to download colorbox to sites/all/libraries/colorbox and even manually copied the colorbox folder to profiles/commerce_kickstart/libraries/colorbox (which according to version control only modified the README.md file and added colorbox/i18n/jquery.colorbox-pt-br.js). I still get the status error message and colorbox does not function on the gallery page it was being used on.
There are no JS errors on the page and I tried all sorts of things on sites/all/libraries/colorbox including copying the colorbox folder into itself to create sites/all/libraries/colorbox/colorbox and changing the permissions of the sites/all/libraries/colorbox folder and everything inside to global read/write but it's still broken.
[UPDATE]: I managed to fix it by downloading the colorbox module to sites/all/modules/contrib which means we will have to maintain it outside of Commerce Kickstart now, but at least it works.