Posted by dkingofpa on May 21, 2010 at 2:01pm
4 followers
| Project: | Thickbox |
| Version: | 6.x-1.6 |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | frjo |
| Status: | needs work |
Issue Summary
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.
Comments
#1
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.
#2
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
#3
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?
Objectclose: 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
#4
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.
#5
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).
#6
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.
#7
not help in my situation...
i have the same:
#8
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...
#9
Thanks! Had the same problem. The latter solution has helped.