Page MenuHomePhabricator

ResourceLoader suppressed on Meta-Wiki translation pages due to a broken gadget
Closed, ResolvedPublic

Description

The presence of active translation extension tags on a page suppresses resource loader. Affecting visual editor, wikitext editor toolbar, central notice etc.

Example:

Suppressed (SubPage): https://meta.wikimedia.org/w/index.php?title=WikiWomen%27s_Collaborative/Twitter/ast&banner=WLM17_gb_test0&uselang=en&force=1
Suppressed (Main Translated Source Page): https://meta.wikimedia.org/w/index.php?title=WikiWomen%27s_Collaborative/Twitter&banner=WLM17_gb_test0&uselang=en&force=1
Working (No translate tags present): https://meta.wikimedia.org/w/index.php?title=Steward_requests/Username_changes/2011-11&banner=WLM17_gb_test0&uselang=en&force=1

Translatable pages work fine on other wikis (tested on mediawiki.org and Commons).

The bug cannot be reproduced when appending &debug=true.

Event Timeline

Jseddon renamed this task from CentralNotice Banners suppressed by Translation Extension to CentralNotice Banners suppressed by Translation Extension on wiki pages.Sep 7 2017, 1:13 PM
Jseddon triaged this task as High priority.
Jseddon updated the task description. (Show Details)
Jseddon renamed this task from CentralNotice Banners suppressed by Translation Extension on wiki pages to ResourceLoader suppressed by Translation Extension on Meta wikipages.Sep 7 2017, 3:35 PM
Jseddon updated the task description. (Show Details)
Jseddon added a subscriber: gpaumier.
Jseddon raised the priority of this task from High to Unbreak Now!.Sep 7 2017, 3:44 PM

Is this new behaviour or just newly-spotted?

This a new issue and one I have noticed since at least Tuesday

OK. Nothing obvious in Translate's recent git history, nor in the changes to ResourceLoader.

Nemo_bis renamed this task from ResourceLoader suppressed by Translation Extension on Meta wikipages to ResourceLoader suppressed by the Translate extension on Meta-Wiki pages.EditedSep 7 2017, 3:58 PM
Nemo_bis subscribed.

JavaScript has disappeared in various places including Special:Upload on Commons (T175147) so I doubt this is related to Translate specifically. (I see however that specific issue was fixed, while I don't see any error in the console here.)

(And nothing in CentralNotice either.)

Nicer trace:

Uncaught TypeError: Cannot read property 'valueOf' of undefined
    at String.toLocaleString (jquery.i18n.js?47d68:53)
    at add (load.php?debug=true&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=0ynbgde:9508)
    at buildParams (load.php?debug=true&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=0ynbgde:9497)
    at Function.jQuery.param (load.php?debug=true&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=0ynbgde:9528)
    at mw.Api.ajax (api.js?f05d6:229)
    at mw.Api.get (api.js?f05d6:134)
    at mw.Api.getMessages (messages.js?a5f29:22)
    at mw.Api.loadMessages (messages.js?a5f29:49)
    at HTMLDocument.<anonymous> (load.php?debug=true&lang=en&modules=ext.gadget.CurIDLink&only=scripts&skin=vector&version=1gca6t2:14)
    at fire (load.php?debug=true&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=vector&version=0ynbgde:3148)

The message it is trying to load is "Link-by-id". So it seems the gadget CurIDLink has something to do with this.

jquery.i18n overrides String.toLocaleString method (maybe not a good idea), but somehow that ends up called without this being set.

If I disable the enabled by default gadget named Adds Link by ID to the instruments on sidebar which is the link to the page with its page ID instead of title. in preferences, the error goes away.

var api = new mw.Api();
api.loadMessages( 'Link-by-id', 'Link-by-id-desc' ).done( linkById );

I guess this was meant:

var api = new mw.Api();
api.loadMessages( [ 'Link-by-id', 'Link-by-id-desc' ] ).done( linkById );
Nemo_bis renamed this task from ResourceLoader suppressed by the Translate extension on Meta-Wiki pages to ResourceLoader suppressed on Meta-Wiki translation pages.Sep 7 2017, 4:25 PM
Nemo_bis closed this task as Resolved.
Nemo_bis assigned this task to Nikerabbit.
Nemo_bis added a subscriber: Base.

Wooohoo, nice catch @Nikerabbit! Thanks also @Nemo_bis and everyone else :)

Jdforrester-WMF renamed this task from ResourceLoader suppressed on Meta-Wiki translation pages to ResourceLoader suppressed on Meta-Wiki translation pages due to a broken gadget.Sep 7 2017, 4:41 PM

Thanks for catching! For some reason it actually worked so I did not notice that something got broken.