I just installed the newest version to my site for use with the image gallery module. Instead of description, alt tag, or node title, I'm seeing the Only local images are allowed. tag. There doesn't appear to be any configuration option about this, and although I found the section of the code that is supposed to define the caption with these things, I don't know enough to figure out why it's not working.

Thanks!

Comments

bmblack’s picture

I'm having the same issue! Can somebody please help?

hutch’s picture

This is probably due to Drupal's filters, not Thickbox as such.

safetypin’s picture

I glanced through the thickbox module code, and I could only find references to "caption" in the javascript. Does anyone know where the PHP code is?

frjo’s picture

Do you have a theme override for theme_imagefield_image_imagecache_thickbox() in your theme?

In Thickbox 6.x-1.5 that function was updated (http://drupal.org/node/570774) so you will need to update it in your theme also.

mwolfe38’s picture

I'm having the same issue and I do not seem to have an override for theme_imagefield_image_imagecache_thickbox,
I grepped for it as shown here:

[ps10745]$ grep -r "theme_imagefield_image_" .
./sites/all/modules/thickbox/thickbox.module: * Implementation of theme_imagefield_image_imagecache_thickbox().
./sites/all/modules/thickbox/thickbox.module:function theme_imagefield_image_imagecache_thickbox($namespace, $path, $alt = '', $title = '', $gid = '', $attributes = NULL) {
[ps10745]$

I don't understand what might be causing this, any ideas?

frjo’s picture

When you override a theme function you replace "theme" with the name of your theme so you should grep for "imagefield_image_imagecache_thickbox" instead.

mwolfe38’s picture

This is what i get for that:

[ps10745]$ grep -r "imagefield_image_imagecache_thickbox" .
./sites/all/modules/thickbox/thickbox.module:    'imagefield_image_imagecache_thickbox' => array(
./sites/all/modules/thickbox/thickbox.module:      return theme('imagefield_image_imagecache_thickbox', $namespace, $item['filepath'], $item['data']['alt'], $item['data']['title'], $gallery_id);
./sites/all/modules/thickbox/thickbox.module: * Implementation of theme_imagefield_image_imagecache_thickbox().
./sites/all/modules/thickbox/thickbox.module:function theme_imagefield_image_imagecache_thickbox($namespace, $path, $alt = '', $title = '', $gid = '', $attributes = NULL) {
[ps10745]$ 

Still not seeing anything theme-related here..

laredo’s picture

HI

Just an FYI I get the same issue , however it seems to work fine from the random image block. Looking into the theme function.

safetypin’s picture

I only just installed this module, not from an upgrade. I definitely do not have any theme functions related to thickbox in my template file or as files in the theme directory. I just installed it, and it functioned like this. I think the only changes I made was to enable thickbox for image nodes and change the image derivative. I just checked that checkbox, and selected "preview" from the menu and then saved.

salvis’s picture

I'm having the same issue using plain-vanilla Garland.

Image and Image Gallery 6.x-1.0-beta3

I've just updated Image and Thickbox to the latest versions.

frjo’s picture

Category: support » bug

I have never used the image module myself and the support for it in Thickbox comes from other contributors.

If someone finds a solution I'll be happy to commit it.

salvis’s picture

I've pretty much stayed away from JS so far...

Can you give me a rough overview in a few sentences of how Thickbox works, and especially where/how it's supposed to get the image caption?

frjo’s picture

Looking through "thickbox_auto.js" that handles the image module integration I believe it's this part that gets the title/caption.

    var title = $(this).attr("title") || img.attr("title") || img.attr("alt") || null;

It looks for the title link, the image title and last the image alt.

Turn off "Enable for image nodes" in the Thickbox settings and take a look at the html that image gallery module outputs, that is what Thickbox has to work with.

Copy one of the links and then turn on "Enable for image nodes" and go back and copy the same link again.

Paste them both in here so we all can see the difference and maybe come up with a solution.

salvis’s picture

The setting of "Enable for image nodes" doesn't matter. Either way I get the following (this is NOT munged by d.o, only line-wrapped by me):

<a
   href="http://example.com/node/1981" 
   title="&amp;lt;img 
      src=&amp;quot;http://example.com/system/files/images/filename.thumbnail.jpg&amp;quot; 
      alt=&amp;quot;Image Title&amp;quot; 
      title=&amp;quot;Image Title&amp;quot; 
      class=&amp;quot;image image-thumbnail &amp;quot; 
      width=&amp;quot;130&amp;quot; 
      height=&amp;quot;88&amp;quot;
   /&amp;gt;"
   alt="&amp;lt;img
      src=&amp;quot;http://example.com/system/files/images/filename.thumbnail.jpg&amp;quot;
      alt=&amp;quot;Image Title&amp;quot;
      title=&amp;quot;Image Title&amp;quot;
      class=&amp;quot;image image-thumbnail &amp;quot;
      width=&amp;quot;130&amp;quot;
      height=&amp;quot;88&amp;quot;
   /&amp;gt;"
>
<img
   src="http://example.com/system/files/images/filename.thumbnail.jpg"
   alt="Image Title"
   title="Image Title"
   class="image image-thumbnail "
   width="130"
   height="88"
/>
</a>

Apparently, Image puts the entire (!), double-escaped (!) <img> tag into the title and alt attributes of the <a> tag.

I've reported this to the Image queue: #591166: Bad links in image galleries (title and alt contain img tag)

salvis’s picture

That was quick: the solution is to disable the image_gallery views, so that you get back the old image_gallery.module. The Image maintainers are trying to get rid of image_gallery.module in favor of a views-based implementation. The latter is praised as more flexible, but it's much less mature.

frjo’s picture

Category: bug » support
Status: Active » Fixed

I mark this as fixed then since it looks like the problem is in the image_gallery views and not in Thickbox.

Please reopen if you think otherwise.

Status: Fixed » Closed (fixed)

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