1999 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Author had a Free File of the Month
  • Won a Competition
  • Bought between 10 and 49 items
+4 more
bitfade says

I just recovered from a 2 hours long “wtf is going on ?? session”
here’s the issue: you call

tb_show('', 'media-upload.php?type=image&TB_iframe=true');

to let user add an image somewhere in your plugin/theme admin area but, as soon as thickbox window is closed, your tabs (or eventually other widget) stop working

Now, during the above session, i discovered that upon closing his windows thickbox calls:

jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload")

Once the Kraken is unleashed (unload event) he eventually reach your widget (jquery ui tabs in my case) which may reacts like this:

OMG ! The Kraken (unload event)! ALL IS LOST ! (self destroy)

Since this didn’t happen before 3.2, i think the issue is related to changes in trigger function with the new jQuery version (1.6)

anyway, the Kraken can be killed using this:

// placed right after tb_show call
$("#TB_window,#TB_overlay,#TB_HideSelect").one("unload",killTheDamnUnloadEvent);

function killTheDamnUnloadEvent(e) {
    // you
    e.stopPropagation();
    // must
    e.stopImmediatePropagation();
    // DIE!
    return false;
}

tought it was worth to share

469 posts
  • Author had a File in an Envato Bundle
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
+1 more
SaurabhSharma says

Thanks for sharing that solution.

Now that we have a thread on WP3 .2 issues, let me share one more thing. There is an auto wrapping of the orphan <li /> tags inside the content editor (as of WordPress 3.2). i.e. when you will try to write the following code:

<li>my list item</li>

and switch between Visual/HTML mode. This code will be converted into:

<ul>
<li>my list item</li>
</ul>

Now since I was using some short code on stylish lists as:

[list params="foo"]
<li>my list item</li>
[/list]

It outputs the following code:

<ul class="as_defined_by_params">
<ul> //the added one by WP
<li>my list item</li>
</ul>
</ul>

For now, I am directly inserting the HTML markup via JS tinyMCE insertion. I am sure there would be some filter to override and prevent this auto wrapping of orphan list items.

Edit: @bitfade, sorry for posting another issue. (I think a single thread will be okay for any such things). Don’t mind mate. :)

1605 posts Building the Web.
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Most Wanted Bounty Winner
  • Bought between 50 and 99 items
  • Has been a member for 4-5 years
+2 more
ZoomIt says

Thanks for sharing

Just one question, how do you get to call tb_show with adding post_id to the parameters ?

I always get this error

invalid regular expression flag A
[Break On This Error] <b>Notice</b>: Undefined index: post_...dia.php on line <b>1423</b><br /> 

814 posts
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
  • Serbia
  • Has been a member for 5-6 years
rvision_ says
bitfade said
tought it was worth to share

Man, you saved me…Same problem here….

I just thought I had to go all over this thickbox crap again and jquery.

Thank you very much :)

1999 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Author had a Free File of the Month
  • Won a Competition
  • Bought between 10 and 49 items
+4 more
bitfade says
rvision_ said
Man, you saved me…Same problem here….

I just thought I had to go all over this thickbox crap again and jquery.

Thank you very much :)
yeah …. pulled my hairs on this
glad it helped
731 posts
  • Elite Author
  • Attended a Community Meetup
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Bought between 50 and 99 items
  • Exclusive Author
  • Most Wanted Bounty Winner
+2 more
mordauk says

Definitely a good catch and glad you shared it! I haven’t run into this problem yet (I don’t think), but I’m sure I will.

435 posts
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Bought between 50 and 99 items
  • Referred between 1000 and 1999 users
  • Europe
  • Sold between 10 000 and 50 000 dollars
  • Envato Studio (Microlancer) Beta Tester
readactor says

thanks for share!

822 posts
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Power Elite Author
  • Won a Competition
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Bought between 50 and 99 items
+2 more
wpbakery says

bitfade Thank you so much! You saved my day!

Envato community + Google = Rock \m/

25 posts
  • Elite Author
  • Germany
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 100 and 199 users
doitmax says

thank you bitfade, saved my day!

by
by
by
by
by
by