This is from another issue which is now closed, but I'm getting the same thing. On the top-right corner is shown: Close,Close or Esc Key,or Esc Key. (Two times Close and 2x Esc key). Is there any way to fix this, even if it's a short term hack?

I'm currently using Thickbox 6.x-1.5 and Splash 6.x-2.5.

CommentFileSizeAuthor
#9 escape-close.gif558 bytesmikeybusiness
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sanestrategy’s picture

I would like to add that I think it's probably a jQuery conflict. I'm currently using Lightbox2 for the entire website, including a photo gallery section. The only reason I'm using Thickbox at all is because it's the only one supported by Splash.

So yeah, currently I use Thickbox ONLY for the Splash implementation.

EDIT: The conflict isn't Lightbox2. I completely removed it from Drupal but Thickbox was still displaying the doubletext. The search continues!

Anonymous’s picture

i second that where to remove?

seanr’s picture

Status: Active » Fixed

Found the problem and fixed it. I'll have a release up later today.

dirksonii’s picture

Status: Fixed » Active

Pardon making this active again, but I think you forgot to release this particular fix, (either in a full release or even a dev release) and I wanted a quick reminder it was still a problem : )

squares’s picture

It seems as though this behavior is caused by the function _thickbox_doheader in the .module being called multiple times.

I didn't have time to sort out why it would need to call the header more than once... but it was pretty apparent that the header was checking to see if it had already been added with this line:

if ($already_added) { return; }

Unfortunately, it doesn't seem like this var is being set to true at any point.

So I changed
STATIC $already_added = FALSE;
to
global $already_added;

and then made sure to set

$already_added = TRUE;

at the very last line of the function.

Again, this may not be the correct fix for this... but if you have a 4pm deadline, and you need this functionality, it works :D

PetarB’s picture

I've got this issue as well. I'll try the quick fix above and let you know how it goes.

PetarB’s picture

Hmmm... maybe I'm missing something. I opened splash.module, and while I could find _thickbox_doheader, I could not see $already_added anywhere. Is is possible to get line numbers for the above fix? Thanks!

rezboom’s picture

the suggested changes in #5 have to be made in thickbox.module. the fix works for me as well. however, an official fix would be appreciated.
thanks!

mikeybusiness’s picture

FileSize
558 bytes

Another Hack:

I just killed it with an addition to my theme CSS file until it get's ironed out.

I hid the duplicate text.

#TB_closeAjaxWindow {visibility: hidden;}

Then added background text to say what I wanted it to say.

#TB_title background: #e8e8e8 url(/sites/default/files/escape-close.gif) no-repeat right;}

The background image says "Escape to Close."

Rizhaya’s picture

I've changed

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

to

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

in the thickbox.module file. It seems to be no duplicates after that.

Shane Birley’s picture

I just added the change in the previous comment and it worked for me. (#10) #5 did not work.

PetarB’s picture

Just confirming #10 worked.
Thank you!

rc2020’s picture

I can confirm this issue, although with the latest edition of thickbox these fixes do not seem to resolve this problem.

Any suggestions?

ionuts71’s picture

#5 worked also. Two steps:
1. Modify thickbox/thickbox.module file

     96 function _thickbox_doheader() {
     97   global $user;
     98 /*  static $already_added = FALSE; */
     99   global $already_added;
    100   if ($already_added) {
    101     return; // Don't add the JavaScript and CSS multiple times.
    102   }
    103
    104   if(_thickbox_active()) {
    105     $path = drupal_get_path('module', 'thickbox');
    106     drupal_add_css($path .'/thickbox.css');
    107     if (variable_get('thickbox_ie_css', 0) != 1) {
    108       drupal_add_css($path .'/thickbox_ie.css');
    109     }
    110
    111     // Insert options and translated strings as javascript settings.
    112     $js_settings = array(
    113       'close' => t('Close'),
    114       'next' => t('Next >'),
    115       'prev' => t('< Prev'),
    116       'esc_key' => t('or Esc Key'),
    117       'next_close' => t('Next / Close on last'),
    118       'image_count' => t('Image !current of !total')
    119     );
    120     drupal_add_js(array('thickbox' => $js_settings), 'setting');
    121
    122     if ($user->uid == 0 && variable_get('thickbox_login', 0)) {
    123       drupal_add_js($path .'/thickbox_login.js');
    124     }
    125
    126     if (variable_get('thickbox_auto', 0) && module_exists('image')) {
    127       drupal_add_js(array('thickbox' => array('derivative' => variable_g        et('thickbox_derivative', 'preview'))), 'setting');
    128       drupal_add_js($path .'/thickbox_auto.js');
    129     }
    130
    131     drupal_add_js($path .'/thickbox.js');
    132   }
    133 $already_added = TRUE;
    134 }

AND after: Performance -> Clear cached data.

#10 Worked also.

seanr’s picture

Project: Splash » Thickbox
Version: 6.x-2.5 » 6.x-1.x-dev

Moving to thickbox as it appears this needs to be fixed there.

seanr’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev

Looks like the 6.x version may have fixed this but it persists in 5.x.

Pomliane’s picture

Status: Active » Closed (won't fix)

This version of Thickbox is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.

kaustubh51’s picture

Hi,

I don't know if this is the solution. I was facing the same problem, In my case I tried all of these but no results. Then I disabled the module thickbox. Then I came to know that I was using ajax module and that module internally install ajax thickbox plugin. And both were applied to my form that's why it was showing close close. So using one of them will solve your problem.

Thanks