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

rapsli’s picture

I would guess it has to do with these changes here http://drupal.org/node/811796

I guess the slash would do the trick...

rapsli’s picture

Status: Active » Fixed

fixed and commited

jenb919’s picture

Version: 6.x-5.0-rc1 » 6.x-5.0

I 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.

cirrus3d’s picture

confirming 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!

Rael’s picture

Hmm, 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:

return '<a href="' . url($image_path) . '" rel="' . $lightbox_type . '[fast_gallery]" title="' . $image->getIptc(variable_get('fg_iptc_settings_title', '<none>')) . '">' . $image->renderHtml() . '</a>';
rapsli’s picture

Version: 6.x-5.0 » 6.x-5.1

oky. There were some problems. I changed it, so that it uses absolute paths.

Rael’s picture

Priority: Normal » Critical
Status: Fixed » Active

Argh, 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 ?

rapsli’s picture

strange. 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?

Rael’s picture

Priority: Critical » Normal
Status: Active » Fixed

Yeah, it's fine. I reinstalled it and all went fine. Thanks.

Status: Fixed » Closed (fixed)

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