Last modified: 2011-01-28 08:12:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T28381, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26381 - Special:BannerController breaks all JS on live site
Special:BannerController breaks all JS on live site
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
CentralNotice (Other open bugs)
unspecified
All All
: High critical (vote)
: ---
Assigned To: Ryan Kaldari
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-21 06:32 UTC by Max Semenik
Modified: 2011-01-28 08:12 UTC (History)
2 users (show)

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


Attachments
Dragonfly debug info (7.06 KB, text/plain)
2011-01-13 06:18 UTC, Max Semenik
Details

Description Max Semenik 2010-12-21 06:32:04 UTC
Seen on mw.org in Opera 11:

Uncaught exception: ReferenceError: Undefined variable: jQuery

Error thrown at line 28, column 0 in http://www.mediawiki.org/w/index.php?title=Special:BannerController&cache=/cn.js&283-17:
    ( function( $ ) {

Screws up all JS on page.
Comment 1 Roan Kattouw 2010-12-21 11:10:20 UTC
Works for me in Firefox, and the inclusion order in <head> looks correct. Opera is known to have issues with loading order, though.
Comment 2 Ryan Kaldari 2010-12-21 18:57:46 UTC
Works for me as well. I suppose I could have CentralNotice make sure that jQuery is defined before it does anything. Any other suggestions?
Comment 3 Ryan Kaldari 2011-01-05 18:00:41 UTC
Tested mediawiki.org and en.wikipedia.org in Opera 11 with CentralNotice banners running, but was not able to reproduce the bug. Max, can you describe the steps to reproduce this bug? Are you still seeing it?
Comment 4 Max Semenik 2011-01-05 19:25:44 UTC
Works for me from home. Probably, something weird with transparent proxy at work. Will investigate this after holidays.
Comment 5 Ryan Kaldari 2011-01-12 18:11:21 UTC
Hey Max, were you able to investigate this at work?
Comment 6 Lupo 2011-01-12 21:30:55 UTC
JavaScript crash in FF 3.6.4. Observed while visiting the Commons in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4, may possibly also occur in other browsers.

The crash occurs during $j(document).ready() and prevents later document-ready handlers from running at all.

FF error console reports:

uncaught exception: [Exception... "Component returned failure code: 0x805e000a [nsIXMLHttpRequest.open]" nsresult: "0x805e000a (<unknown>)" location: "JS frame :: http://bits.wikimedia.org/skins-1.5/common/jquery.min.js?283-19 :: anonymous :: line 383" data: no]

This appears to be caused by the call on lines 54-58 in http://commons.wikimedia.org/wiki/Special:BannerController

var request = $.ajax( {
	url: bannerListURL,
	dataType: 'json',
	success: $.centralNotice.fn.chooseBanner
} );

The bannerListURL at the time of the call is

http://commons.wikimedia.org/w/index.php?title=Special:BannerListLoader&cache=/cn.js&language=en&project=commons&country=

and returns

[]

which is not a JSON object but an empty array. Maybe that's got something to do with this. Can't verify myself since I cannot step though minified jquery code; I did get to this $.ajax() call with single-stepping, though. $.centralNotice.fn.chooseBanner is never called; the exception is therefore raised earlier inside the $.ajax() call. 

The error appears not to depend on the skin, at least it occurs in both monobook and in vector.
Comment 7 Max Semenik 2011-01-13 06:18:10 UTC
Created attachment 7984 [details]
Dragonfly debug info

Here's what I've discovered. Everything seems to be loaded, but jQuery is a roast. Errors look different at different times (at the moment of reporting the BannerController error was first in the list, so I decided that it is to be blamed). Sometimes, there are no errors and JS works, but most of time it's completely screwed up.
Comment 8 Ryan Kaldari 2011-01-14 23:34:44 UTC
@Lupo: '[]' is the correct json encoding for an empty array. That shouldn't cause any problems. In fact, '[]' is the value that is normally expected to be returned (when we aren't running banners).
Comment 9 Max Semenik 2011-01-28 08:12:57 UTC
Never mind, I'm an idiot. It was an Opera extension screwing up things.

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


Navigation
Links