https://bugzilla.wikimedia.org/show_bug.cgi?id=29726
Web browser: ---
Bug #: 29726
Summary: On some pages all js-messages are broken
Product: MediaWiki
Version: 1.17
Platform: All
OS/Version: All
Status: ASSIGNED
Severity: normal
Priority: Unprioritized
Component: Resource Loader
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
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.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l