Posted by ndeschildre on June 10, 2009 at 2:25pm
| Project: | Quick Tabs |
| Version: | 6.x-3.0-beta1 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
| Issue tags: | Release blocker |
Issue Summary
Hello,
I'm using a quicktabs on IE7. When the page is loaded, it will hide the first tab page. When clicking the second tab link, it will show the first tab page. When clicking the third tab link, it will show the second page, and so on...
I've debugged a bit, and key happen to return 'indexOf' at some point. As a result, i is not right. Not really sure why it happens. See the patch.
This bug only affect IE7 (IE8, FF ok), this patch correct the issue on these browsers.
Thanks!
| Attachment | Size |
|---|---|
| quicktabs-ie7.patch | 659 bytes |
Comments
#1
I have tested this, the tab selection works without problem in IE7..
the patch is wrong as key can be a string and tabIndex is a number..
first thing you should check, if the page is a valid HTML, as that is the most common problem when something does not work in some browsers..
use http://validator.w3.org/
or the firefox plugin: Html Validator
#2
Weird.
I'll look deeper on that.
Thanks.
#3
I had the same problem (#508284: Tab's content is moved to next tab (IE6 & IE7)), patch listed above solves it so far...
#4
I confirmed the issue in #508284: Tab's content is moved to next tab (IE6 & IE7) so this is actually a bug, but the patch is not good enough as described in comment #2.
#5
tagging
#6
The patch works for me...
Has anyone had any actual problems because of it...?
#7
yes,
#2: the patch is wrong as key can be a string and tabIndex is a number..
#8
@Pasqualle: can you say that in a practical kind of way...?
I truly don't understand what that really means, and would appreciate if you could use an example for all us dummies ;)
And.. everything does seem to work... so if simply must refrain from doing something (which apparently i haven't done yet) that could be an acceptable workaround for now...
Thanks!
#9
if you create the quicktab through the admin UI, then the tab key is 0, 1, 2, 3 ..
but it you create the quicktab with code #332895: render quicktab programatically, then the tab key could be anything like 'first', 'second', 'third'
in this case the patch will break the functionality..
#10
Looks like this is a bug that appears only in IE7.
Line 51 in quicktabs.js needs to be changed from
this.tabpage_id = 'quicktabs_tabpage_' + this.qtid + '_' + this.tabKey;
to
this.tabpage_id = 'quicktabs_tabpage_' + this.qtid + '_' + this.tabIndex;
#11
Hello,
I think a lot of people are facing different issues because of the same problem. My issue was "content disappeared in all tabs in IE 7". I had debugged a little in Firebug and found that browsers behave differently with these Drupal.settings.quicktabs[qtKey].tabs.
I don't know what was the reason for the introduction of "var i", but without it the script works perfectly in FF,IE7,Chrome and Safari. Hope this patch would help somebody.
------------------------------------------------
You can always find me here - http://andrei.in.ua
#12
@tabakerka: your patch is the same as the previous, so your patch is also wrong
from comment #1
#13
@tabakerka: and please do not put personal links into issue comments, otherwise your account could be banned..
#14
Patch #1 & #11 fixed the problem for me. Thank you.
#15
I am experiencing this problem also. My page validates as XHTML 1.0 Transitional as intended, however in ie7 and ie7 only, the tabs are incorrect.
You can see this problem at: https://library.waubonsee.edu/
#16
I did some more exploration of this problem. It seems, as said in the initial post, that for some reason in ie7, the first element of 'Drupal.settings.quicktabs[qtKey].tabs' that is returned in the for loop is the string "indexOf".
This throws off the correlation between the tabs, and the index variable i. I threw together a quick hack that ignores this value when incrementing the index variable i. This seems to have solved the problem for me, without breaking the ability to use non numeric keys for tabs.
I have not tracked down what is actually causing indexOf to appear in the settings array, but if that can be solved that would be a better fix.
When looking over the page source I can see that initially when Drupal builds the page code, 'Drupal.settings.quicktabs[qt_1].tabs' equates to "tabs": [ 0, 0, 0, 0, 0 ]
however my other quicktab, qt_2 has a much more robust array of data:
{ "tabs": [ { "bid": "account_delta_0", "hide_title": 1, "title": "Summary", "weight": "-10", "type": "block" }, { "bid": "account_delta_1", "hide_title": 1, "title": "On Loan", "weight": "-9", "type": "block" }, { "bid": "account_delta_3", "hide_title": 1, "title": "Holds", "weight": "-8", "type": "block" }, { "bid": "account_delta_2", "hide_title": 1, "title": "Bills", "weight": "-7", "type": "block" } ] }
I have attached my patch to this message.
#17
After many headaches, (and unfortunately before I found this post) I also made a patch that fixes this error. I believe it basically the same as patch #16 .
+1 that it works. Hope it gets committed soon.
#18
Not sure if this is the case here, but I suspect this is a common javascript error that you have made.
I am assuming Drupal.settings.quicktabs[qtKey].tabs is an array. Please excuse if not.
You should never iterate a javascript array using a for ... in loop. It should only be used for properties of objects.
This is because Array is a descendant of Object so when you are performing a for .. in loop you are iterating the properties/methods of the array Object, not only the elements. Usually you get away with it because the default properties and methods are not enumerable. But in this case it looks like some other javascript somewhere is adding an indexOf method to the Array.prototype (it is not standard) and hence you are iterating over it unintentionally.
The patches submitted above will still break things if you mix in another javascript framework that adds other array methods to the prototype apart from indexOf.
The solution: instead you should be using a regular for loop and refer to the array elements by index.
for (var i = 0; i < array.length; i++)#19
I am having a issue with the class .quicktabs-hide being added to both tabpages. When the tabs are clicked the class isn't removed, so no content (it's a views list if that helps). This only happens in ie 7 and ie 6, not sure about 8. Is this related?
I also have two QTs on the page
http://dev.popmontreal.com
thanks for any insight.
#20
#21
As mentioned in #18 the patches in #16 and #17 need a bit of tweaking. Here is a patch that will always work (and as a bonus it applies against CVS!)
#22
#23
I had the problem in IE6 only.
Initial tab didn't display and the other links were out of sinc e.g. 1=0, 2=1, 3=2 etc.
Patch #21 worked perfectly.
Many thanks
#24
Patch #21 worked for me as well, fixing problems in both IE6 and IE7.
#25
Patch #21 worked for me on 6.x-3.0-beta1
#26
@alesand Reg #10
I am to confirm that this worked for me change switch out 'key' with 'Index' . My only concern is if the quicktabs module is later updated and this if not fixed in a new version will be changed back to the original state causing the same issue again.
#27
Fresh install on drupal7 has the same problem on IE6 and IE7. Confirmed patch from #21 mstrelan worked for 7.x-3.0
#28
Confirm it fixes the issue.
#29
Confirm that this is still a problem in Quicktabs 7.x-3.2 and that applying #21 mstrelan patch fixes the problem.
Will this fix be included in the next release of Quicktabs?
#30
just tested the patch from 21 on the 6x3 version and it seems to work.
thx
fre