Last modified: 2011-07-05 23:40:33 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 T31726, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29726 - On some pages all js-messages are broken
On some pages all js-messages are broken
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.17.x
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-05 23:20 UTC by Krinkle
Modified: 2011-07-05 23:40 UTC (History)
3 users (show)

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


Attachments
The mystery caught in the wild (57.52 KB, image/png)
2011-07-05 23:22 UTC, Krinkle
Details
Extracted from r80572, applied to 1.17wmf1 (683 bytes, application/octet-stream)
2011-07-05 23:25 UTC, Krinkle
Details

Description Krinkle 2011-07-05 23:20:55 UTC
On some pages in *WebKit-browsers*, such as :
http://commons.wikimedia.org/w/index.php?title=User_talk:Mdupont&oldid=56180692

... all js-messages are broken (<vector-simplesearch-search>, <showtoc> etc.). However they are loaded fine and in mw.messages.

The problem is caused by .exists() returning false incorrectly.
Map.prototype.exists (1.17wmf1):
        function ( selection ) {
		if ( typeof keys === 'object' ) {
			for ( var s = 0; s < selection.length; s++ ) {
				if ( !( selection[s] in this.values ) ) {
					return false;
				}
			}
			return true;
		} else {
			return selection in this.values;
		}
	}

It incorrectly refers to "keys" instead of "selection" so it will fail for multi-message calls which pass an object. But single-message calls (99.9% of cases) should still work fine, and usually they do.

However on the linked Commons-page even single messages are failing.
> Google Chrome: http://commons.wikimedia.org/w/index.php?oldid=56180692
> mw.msg('showtoc')
> <showtoc>

Root cause ? Obviously the root cause is the function checking the wrong variable, but single-message calls should work fine (which was the reason the fixing part of r80572 wasn't backported, core nor any extension used it).

But on this page there is a <h2 id="keys"> ( == Keys == ), and in WebKit browsers references to elements by ID are in the window object / global namespace.
so window.keys === <h2 id="keys"> (an object, instance of Element).

All this weirdness was fixed as part of r80572. Although initially not considered worth a backport, I think we should consider and actually backport to 1.17 and 1.17wmf1 as currently:
* requesting multiple messages in any browser
* requesting single messages in Chrome on some pages

.. does not work and results in breakages of all messages on the page.
Comment 1 Krinkle 2011-07-05 23:22:04 UTC
Created attachment 8745 [details]
The mystery caught in the wild

Check the screenshot for debugging
Comment 2 Krinkle 2011-07-05 23:25:31 UTC
Created attachment 8746 [details]
Extracted from r80572, applied to 1.17wmf1

Simple fix from r80572, applied to 1.17wmf1.
Comment 3 Brion Vibber 2011-07-05 23:37:24 UTC
Applied on r91504 (REL_1_17) and r91505 (1.17wmf1), should be deployed shortly.
Comment 4 Brion Vibber 2011-07-05 23:40:33 UTC
Pushed by Reedy -- I've confirmed that
http://commons.wikimedia.org/wiki/User_talk:Mdupont renders correct in Chrome
for me after repoking. Yay!

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


Navigation
Links