Why is it printing out the text twice? How do I change what is displayed in the close div? Here is the div that gets printed out:

<div id="TB_closeAjaxWindow"><a href="#" id="TB_closeWindowButton" title="Close,Close">Close,Close</a> or Esc Key,or Esc Key</div>

Thanks for your help.

CommentFileSizeAuthor
#7 1.jpg26.58 KBvmkazakoff
#5 already_added.patch444 bytesdkingofpa
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frjo’s picture

I have never seen this problem and not heard anyone else mention it. Hmm.

Have you by any change managed to translate "Close" to "Close,Close"? Sounds a bit far fetched.

If you are interested in Lightbox features please test the new Colorbox module.

http://drupal.org/project/colorbox

I have ported all Thickbox features to Colorbox so it should work as a drop in replacement.

When Colorbox has a stable release I will start actively recommend people to switch/upgrade from Thickbox to Colorbox. I'm the maintainer of Thickbox and a co-maintainer of Colorbox.

dkingofpa’s picture

I didn't touch any of the files in the module. Just dropped it in and enabled it. I'm using thickbox with the splash module. Any weird interactions there? Thanks

dkingofpa’s picture

I dumped my Drupal.settings.thickbox variable at the top of the tb_show function into the javascript console. Output is below. Why are there two entries in close and esc_key? Where are those populated?

Object
  close: Array (2)
    0: "Close"
    1: "Close"
    length: 2
    __proto__: Array
  esc_key: Array (2)
    0: "or Esc Key"
    1: "or Esc Key"
    length: 2
    __proto__: Array
  image_count: Array (2)
  next: Array (2)
  next_close: Array (2)
  prev: Array (2)
  __proto__: Object
frjo’s picture

It is _thickbox_doheader() in thickbox.module that populates the settings.

Try clearing the Drupal cache and make sure you only have one version of thickbox installed.

dkingofpa’s picture

FileSize
444 bytes

I think I found and fixed the error. _thickbox_doheader() was getting called twice and the $js_settings array was getting added to Drupal.settings.thickbox twice.

In _thickbox_doheader(), the original code looks like this:

  static $already_added = FALSE;
  if ($already_added) {
    return; // Don't add the JavaScript and CSS multiple times.
  }

I changed it so $already_added gets set to TRUE.

  static $already_added;
  if ($already_added) {
    return; // Don't add the JavaScript and CSS multiple times.
  } else {
    $already_added = TRUE;
  }

Does this make sense? I attached a patch (hope it's in the right format).

frjo’s picture

Assigned: Unassigned » frjo
Category: support » bug
Status: Active » Needs review

No idea when this bug managed to get in. Thanks for finding it!

I have committed a fix to 6-dev, slightly different from you patch. Will make a new release soon.

vmkazakoff’s picture

Status: Needs review » Needs work
FileSize
26.58 KB

not help in my situation...

i have the same:

vmkazakoff’s picture

ym...

but i make the next changes in you path:

OLD:
static $already_added;
if ($already_added) {
return; // Don't add the JavaScript and CSS multiple times.
} else {
$already_added = TRUE;
}

MY version:
static $already_added = TRUE;
if ($already_added) {
return; // Don't add the JavaScript and CSS multiple times.
} else {
$already_added = TRUE;

i dont no why, but it help my.

aniway: thanks for you path. It's more easily to find this function.

PS: sorry for my english...

gaintsev’s picture

Thanks! Had the same problem. The latter solution has helped.