Last modified: 2013-11-25 20:14:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 50193 - collapsibleTabs code cleanup: null != undefined, undefined variables passed to .data()
collapsibleTabs code cleanup: null != undefined, undefined variables passed t...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: Low minor (vote)
: 1.23.0 release
Assigned To: Nobody - You can work on this!
gci2013 https://www.mediawiki.org/wik...
: easy
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2013-06-25 20:02 UTC by kipod
Modified: 2013-11-25 20:14 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description kipod 2013-06-25 20:02:13 UTC
so, in 1.22wmf8, there is a new collapsibleTabs.js ( https://bits.wikimedia.org/static-1.22wmf8/skins/vector/collapsibleTabs.js 
)
in line 85 we ask "if ( $settings !== null )".
clearly, this is the wrong question. maybe 

if ( typeof($settings) === "object" )

will work better. 

as it is, when there is no data, "$setting" is undefined, and the test 
$setting != null
returns true, because "null" and "undefined" are two different things.

this cause many things to fail, and in particular, unregistered users lose the "history" tab if they have JS enabled.

peace.
Comment 1 Bartosz Dziewoński 2013-06-26 00:08:07 UTC
(In reply to comment #0)
> so, in 1.22wmf8, there is a new collapsibleTabs.js (
> https://bits.wikimedia.org/static-1.22wmf8/skins/vector/collapsibleTabs.js

It has been moved from the Vector extension with almost no changes, see Gerrit change #55524 and Gerrit change #56711. This part in particular was not changed (https://gerrit.wikimedia.org/r/#/c/56711/5/modules/jquery.collapsibleTabs.js vs https://gerrit.wikimedia.org/r/#/c/55524/13/skins/vector/collapsibleTabs.js).

So this either actually magically works, or has never worked. (I haven't tested right now.)
Comment 2 Bartosz Dziewoński 2013-06-26 00:40:54 UTC
[Unlike bug 50196 this isn't critical, as as far as I can see it doesn't break stuff.]
Comment 3 kipod 2013-06-26 00:56:35 UTC
i definitely experienced exceptions caused by this, but this was while chasing bug 50196, which turned out to be, as you noted, unrelated.

i do not have a good reproduction recipe to demonstrate those exceptions, but it is clearly a bug.

i agree that setting it to "critical" maybe was a bit panicky - again, at the time i thought this issue was the source of the 50196 behavior.

peace.
Comment 4 Bartosz Dziewoński 2013-06-29 13:55:54 UTC
This currently doesn't cause any bad behavior as far as I can see ($settings will never be undefined, apparently), but it's obviously a bug.

There's also something else in this file:

// XXX: 'data' is undefined here, should the 'data' from the outer scope have
// a different name?
$( this ).detach().prependTo( target ).data( 'collapsibleTabsSettings', data );


It would be nice if someone spent some time trying to understand what all that code is doing.

Adjusting bug summary and metadata.
Comment 5 Gerrit Notification Bot 2013-11-23 16:11:03 UTC
Change 96918 had a related patch set uploaded by Yamelnychuk:
Fix collapsibleTabs code cleanup: null != undefined & undefined variables passed to .data().

https://gerrit.wikimedia.org/r/96918
Comment 6 Gerrit Notification Bot 2013-11-25 20:12:42 UTC
Change 96918 merged by jenkins-bot:
Fix collapsibleTabs code cleanup: null != undefined & undefined variables passed to .data().

https://gerrit.wikimedia.org/r/96918
Comment 7 Bartosz Dziewoński 2013-11-25 20:14:50 UTC
Fixed by Yaroslav as a GCI task, should be all pretty now. kipod, I hope this makes you happy ;)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links