Closed (fixed)
Project:
Fast Gallery
Version:
6.x-5.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Jun 2010 at 22:50 UTC
Updated:
8 Jul 2010 at 12:30 UTC
Hello,
Trying to open an image from a subfolder in the gallery results in a 404 error. The links appear to be aliasPath/imagePath.jpg that obviously doesn't exist.
The issue seems to be located at line 309 of fast_gallery.module:
return '<a href="' . $image_path . '" rel="' . $lightbox_type . '[fast_gallery]" title="' . $image->getIptc(variable_get('fg_iptc_settings_title', '<none>')) . '">' . $image->renderHtml() . '</a>';
should be instead:
return '<a href="/' . $image_path . '" rel="' . $lightbox_type . '[fast_gallery]" title="' . $image->getIptc(variable_get('fg_iptc_settings_title', '<none>')) . '">' . $image->renderHtml() . '</a>';
Comments
Comment #1
rapsli commentedI would guess it has to do with these changes here http://drupal.org/node/811796
I guess the slash would do the trick...
Comment #2
rapsli commentedfixed and commited
Comment #3
jenb919 commentedI was using 6.x-5.0-beta4 and had no issue with lightbox2. I upgraded to 6.x-5.0 which uses the slash and the path was wrong. Instead of adding the relative path it added the absolute path and no image would appear in the lightbox. I removed the slash in
return '<a href="/' . $image_path . '" rel="' . $lightbox_type . '[fast_gallery]" title="' . $image->getIptc(variable_get('fg_iptc_settings_title', '<none>')) . '">' . $image->renderHtml() . '</a>';
that was recently added and everything works again. I also have several sub-folders and everything is fine.
Comment #4
cirrus3d commentedconfirming that removing the slash fixed the error for me too.
I used to get the following link:
http://mysite.com/http://mysite.com/sites/default/files/imagecache/.......
I tried to solved this for 2 hours because I thought it was a problem with imagecache.
Thanks a lot!
Comment #5
Rael commentedHmm, are you guys using http://yoursite.com as drupal basepath ? If so that could be the problem.
maybe something like this will work for every situation:
Comment #6
rapsli commentedoky. There were some problems. I changed it, so that it uses absolute paths.
Comment #7
Rael commentedArgh, the 6.x-5.1 version gives white screen of death if $base_url isn't set. $base_url is optional in sites/default/settings.php. What about using global $base_path, instead ?
Comment #8
rapsli commentedstrange. Even if you don't set the $base_url it's going to be set. Do you have PHP Error notifications set? Does the log tell you something about the error?
Comment #9
Rael commentedYeah, it's fine. I reinstalled it and all went fine. Thanks.