Page MenuHomePhabricator

[Regression] mediawiki.legacy.wikibits uses mw.util, dependency missing
Closed, ResolvedPublic

Description

In Bug 33711, Krinkle said it is the way to go that we have to add dependencies for mw.util. But mediawiki.legacy.wikibits uses this module and does not wait and fails in non-debug-mode only. The following line was extracted by firebug:

'windows')!=-1;window.is_ff2_x11=is_ff2&&clientPC.indexOf('x11')!=-1;window.is_opera=window.is_opera_preseven=window.is_opera_95=window.opera6_bugs=window.opera7_bugs=window.opera95_bugs=false;if(clientPC.indexOf('opera')!=-1){window.is_opera=true;window.is_opera_preseven=window.opera&&!document.childNodes;window.is_opera_seven=window.opera&&document.childNodes;window.is_opera_95=/opera\/(9\.[5-9]|[1-9][0-9])/.test(clientPC);window.opera6_bugs=is_opera_preseven;window.opera7_bugs=is_opera_seven&&!is_opera_95;window.opera95_bugs=/opera\/(9\.5)/.test(clientPC);}window.ie6_bugs=false;if(/msie ([0-9]{1,}[\.0-9]{0,})/.exec(clientPC)!=null&&parseFloat(RegExp.$1)<=6.0){ie6_bugs=true;}window.doneOnloadHook=undefined;if(!window.onloadFuncts){window.onloadFuncts=[];}window.addOnloadHook=function(hookFunct){if(!doneOnloadHook){onloadFuncts[onloadFuncts.length]=hookFunct;}else{hookFunct();}};window.importScript=function(page){var uri=mw.config.get('wgScript')+'?title='+mw.util.wikiUrlencode(page)+

Note the mw.util.wikiUrlencode.


Version: 1.20.x
Severity: normal

Details

Reference
bz33760

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:03 AM
bzimport set Reference to bz33760.

I assume this happens because I have a call to importScript in my [http://commons.wikimedia.beta.wmflabs.org/wiki/User:Rillke/common.js common.js].

But nevertheless mediawiki.legacy.wikibits should not expose a function that is not working.

Error:
mw.util is undefined
http://commons.wikimedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery.client%7Cmediawiki.legacy.wikibits%7Cmediawiki.page.startup&skin=vector&version=20120111T105301Z&*
Line 5

Created attachment 9877
Proposal: Add a dependency to /mediawiki/trunk/phase3/resources/Resources.php

Did not check any deadlock possibility.

Attached:

(wikibits.js)
window.importScript = function( page ) {
var uri = mw.config.get( 'wgScript' ) + '?title=' +

		mw.util.wikiUrlencode( page ) +
		'&action=raw&ctype=text/javascript';

return importScriptURI( uri );
};

yes, it uses mw.util. Dependency must be added, no-brainer. Thanks!

Applied among other missing dependencies in r109680.
Thank Rainer!