I have just upgraded to 1.10 and images within my content are broken (I also tried the latest dev).

E.g. I have an image "<img src="/sites/all/images/bb_small.png" class="bb_icon_small" alt="yes" />". Everything is fine during editing and in the preview (btw.: I had this content there way before the upgrade), but when I look at the page after the update to 1.10, instead of seeing the image, I see the exposed html code (note that the "<img" is missing):

rel="lightbox" src="/sites/all/images/bb_small.png" class="bb_icon_small" alt="yes" />

I had to go back to the last lightbox2 version that worked for me (incl. the security risk).

Please advise as soon as possible.

CommentFileSizeAuthor
#4 920008.patch824 bytesstella

Comments

Qluripax’s picture

I also noticed that when upgrading 3 production sites yesterday. Unfortunately I reported that wrong in an issue for 6.x-1.9... (My bad).

Trying some diff:s between the versions (Stella has done a big work) I saw something interesting in lightbox2.module that I think is the problem:

At row 405 in lightbox2.module we have the following:

   case 'process':
      if ($delta == 1) {
        $text = ' '. $text .' ';
        $text = preg_replace('/ShowItem/', 'DownloadItem', $text);
        $text = preg_replace('/<img\s+[^<]*src="/', 'rel="lightbox" src="', $text);
        $text = drupal_substr($text, 1, -1);
      }

Looking at this:

 $text = preg_replace('/<img\s+[^<]*src="/', 'rel="lightbox" src="', $text);

The code is replacing 'img src' with only 'src'. Replaing that row with the same from prevous version would fix that problem.

Corrected code would be like:

   case 'process':
      if ($delta == 1) {
        $text = ' '. $text .' ';
        $text = preg_replace('/ShowItem/', 'DownloadItem', $text);
        $text = preg_replace('/src="/', 'rel="lightbox" src="', $text);
        //$text = preg_replace('/<img\s+[^<]*src="/', 'rel="lightbox" src="', $text);
        $text = drupal_substr($text, 1, -1);
      }

At least that made me to put my production sites online again. :-)

chrisal’s picture

Due to the same bug I had to revert to 1.9 release.
Thanks for 1.11 !

Troodon’s picture

I noticed this too and after a bit of fiddling I got it images displaying again: check if you have the lightbox2 "g2 filter" input filter enabled and if you dont actually need it try disabling the "g2 filter" and see if images display again.

stella’s picture

Status: Active » Fixed
StatusFileSize
new824 bytes

Fixed in today's dev release, or try the attached patch.

@chrisal - don't revert to 1.9, that's very insecure. Use the patch or the dev release for now, or just disable the G2 filter - you only need that filter if you require Gallery2 integration.

megic’s picture

Thank you for addressing the issue so fast. :)

What are the differences between the released 1.10 and the latest dev (other than the bug fix)?

stella’s picture

just a few other critical bug fixes. New release coming tomorrow though.

megic’s picture

ok, I'll wait for 1.11 then ... thanks in advance.

Status: Fixed » Closed (fixed)

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

Evariste-1’s picture

Status: Closed (fixed) » Active

I just upgraded to 1.11 from 1.9 and I also had to roll back to 1.9 to get lightbox to work again. I tried 1.10 with but that didn't work either. I'm also having these problems with images that are part of a content-type created with CCK and Image.

When I'm using 1.11, the parent anchor tag of these images in a view has no lightbox markup whatsoever. Only the href attribute. I tried disabling g2, but that didn't work. I do have a custom module that hooks on to _image_gallery and _image_display. But, I get the same result even if I disable my custom module.

I'm really not sure where to look at all. Any help/direction greatly appreciated.

Thanks in advance.

Evariste-1’s picture

Just found out that the new version of Lightbox2 works with the other themes (Garland & Rootcandy), so now I am looking at my theme (that was built using Zen as a starting theme). Something I did is breaking Lightbox2 by preventing it from adding the necessary markup to the anchor tag.

Any ideas?

Evariste-1’s picture

OK, I tried using the Zen theme and Lightbox2 will work if I am logged in, but won't work for the anonymous user.

Seems like it could be a permissions issue, but I tried granting anonymous both permissions for Lightbox2 (not a good idea to give them admin) and that didn't work either.

My image gallery is implemented through views.

Evariste-1’s picture

Status: Active » Fixed

Finally got it to work!

I gave permission to the anonymous user to "view original image" in the image module permissions, and that was it!

Status: Fixed » Closed (fixed)

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