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!

Comments

pasqualle’s picture

Category: bug » support

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

ndeschildre’s picture

Weird.

I'll look deeper on that.

Thanks.

kotu’s picture

I had the same problem (#508284: Tab's content is moved to next tab (IE6 & IE7)), patch listed above solves it so far...

pasqualle’s picture

Category: support » bug
Status: Active » Needs work

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.

pasqualle’s picture

Issue tags: +Release blocker

tagging

asak’s picture

The patch works for me...

Has anyone had any actual problems because of it...?

pasqualle’s picture

yes,
#2: the patch is wrong as key can be a string and tabIndex is a number..

asak’s picture

@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!

pasqualle’s picture

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..

alesand’s picture

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;

tabakerka’s picture

StatusFileSize
new654 bytes
new654 bytes

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

pasqualle’s picture

@tabakerka: your patch is the same as the previous, so your patch is also wrong
from comment #1

the patch is wrong as key can be a string and tabIndex is a number..

pasqualle’s picture

@tabakerka: and please do not put personal links into issue comments, otherwise your account could be banned..

jdlind38’s picture

Patch #1 & #11 fixed the problem for me. Thank you.

cap60552’s picture

Version: 6.x-2.0-rc3 » 6.x-2.0-rc4

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/

cap60552’s picture

Status: Needs work » Needs review
StatusFileSize
new638 bytes

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.

dooug’s picture

StatusFileSize
new881 bytes

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.

mr.j’s picture

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++)

delmarr’s picture

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.

pasqualle’s picture

Priority: Normal » Critical
mstrelan’s picture

StatusFileSize
new971 bytes

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!)

kevin.reiss’s picture

Version: 6.x-2.0-rc4 » 6.x-2.0-rc5
masher’s picture

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

bradweikel’s picture

Status: Needs review » Reviewed & tested by the community

Patch #21 worked for me as well, fixing problems in both IE6 and IE7.

rockitdev’s picture

Version: 6.x-2.0-rc5 » 6.x-3.0-beta1

Patch #21 worked for me on 6.x-3.0-beta1

Sjarsena’s picture

@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.

makangus’s picture

Fresh install on drupal7 has the same problem on IE6 and IE7. Confirmed patch from #21 mstrelan worked for 7.x-3.0

franz’s picture

Confirm it fixes the issue.

Foole’s picture

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?

Frederic wbase’s picture

just tested the patch from 21 on the 6x3 version and it seems to work.

thx

fre

justindodge’s picture

This is still an issue for 7.x-3.3
The patch no longer applies, but I wrote it in manually and it solves the issue.
I'll try to re-roll for 7.x-3.3 if/when I get a chance, but it's only a couple lines for anyone else that's having this issue and needing a fix immediately.

justindodge’s picture

Version: 6.x-3.0-beta1 » 7.x-3.x-dev
StatusFileSize
new767 bytes

Here's the patch from #21 but rolled against the current 7.x-3.x-dev branch.

rudetrue’s picture

#32 fixes the issue for me as well in IE

ultimateboy’s picture

Status: Reviewed & tested by the community » Fixed

An issue 4 years in the making... finally committed #32 to 7.x-3.x.

Thank you all for the contribution.

http://drupalcode.org/project/quicktabs.git/commit/88d0ba4d7d6715e7bf58b...

Status: Fixed » Closed (fixed)

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

japerry’s picture

Status: Closed (fixed) » Needs work

Sorry to put a bug in 'yall -- but QT is broken now for other browsers, and we had to revert this issue for commons:

#2104643: Quicktabs breaks when tabs are hidden

smustgrave’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

With D7 EOL approaching in a month I'm starting to triage the D7 side of quicktabs queue. This doesn't appear to have any code so believe this may not make it, sorry! Thanks though!

If still an issue or needed for 4.0.x (latest branch) feel free to reopen

With IE gone also.

mstrelan’s picture

Wow, blast from the past here.

With IE gone also.

Not only is IE gone, this was only an issue in IE7! Furthermore, this issue pre-dated Drupal's use of Git, as the patch applied to CVS.

smustgrave’s picture

lol currently triaging this queue, closing most issues but a few stuff I'll merge into D7 branch and do 1-2 last releases.