Project:Tabs (jQuery UI tabs)
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

If tabset_name isn't given, it defaults to tabset.

tabset_name goes through form_clean_id

however, the id that is used is actually tabs-tabset_name, which form_clean_id isn't told so doesn't keep track

Then later in the code the tabs_names are set to tabs-tabset_name-1.

So image two tabs with tabset_names not set till arriving at the function. they're given the name tabset. Form cleans this to tabset-1 on the second. However tabs-tabset-1 is what the actual id.. which is what also the first tab in the first tabset is also id.

The simpliest solution is to add 'tabs-' . () inside the form_clean_id when determining tabname, but it causes uglier ids later. But if that's okay, I'll mke a patch.

Comments

#1

Thanks for the report, please go ahead and generate a patch. That'll help see the precise source of the issue.

#2

Here ya go,
Removes "tabs- from the theme function and moves it into the initial form_clean_id

The second patch isn't tested yet (made it while writting about how the above patch creats tabs-tabs-tabset class later on and figured it'd be relevant to try and not have that happen).

AttachmentSize
tabs_dup_id.patch 1.46 KB
tabs_dup_id_1.patch 1.93 KB

#3

Meh, fail @ my last patch.

Here's the corrected patch.

AttachmentSize
tabs_dup_id_1.patch 1.99 KB

#4

Looks like all the fixes are in tabs_dup_id_1.patch eh? This worked as expected for me! I had posted about this problem here: http://drupal.org/node/650658 Thanks for the fix!

#5

Yes, Thank for the fix... very timely.

I had to apply it manually as my patch (openSuse 11.1) says for tabs_dup_id_1.patch :
patching file tabs.module
patch: **** malformed patch at line 27: @@ -81,7 +81,7 @@
(I do have Tabs 6.x-1,2 installed)

#6

Status:active» fixed

Thanks, committed a slightly altered fix.

#7

It LOOKS like this is trying to solve the duplicate ID issue, but it either still has with a problem in tabs_panel_style or has created a new one.
http://drupal.org/node/581354#comment-2533268

From what I can see
The problem is using the same type of suffix as form_clean_id does to number child element
form_clean_id() appends -1, -2 sometimes, and so does this child-id-generator. Sometimes they double up. sometimes they conflict

#8

Status:fixed» closed (fixed)

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

#9

FYI, it appears this fix doesn't hold if using panels caching. If a panel using tabs caches its HTML, then the form_clean_id() numbering doesn't see it next time. This can produce a page with duplicate #tabset-1 containers (which causes misbehaviour).

Workaround is probably either cache everything or cache nothing.
the cause - form_clean_id() vs partial page cache is a wider issue I guess.

Noting this in the closed issue here because it's relevant, but not sure if there is a way to solve it.

nobody click here