r91261 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91260‎ | r91261 | r91262 >
Date:12:52, 1 July 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
jquery.form was not included in <1.18, but declaring it unconditionally results in:
MediaWiki internal error.
Original exception: exception 'MWException' with message 'ResourceLoader duplicate registration error. Another module has already been registered as jquery.form' in /www/sandwiki/includes/resourceloader/ResourceLoader.php:222
Modified paths:
  • /trunk/extensions/Translate/Translate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Translate.php
@@ -161,6 +161,13 @@
162162 'scripts' => 'js/jquery.autoresize.js',
163163 ) + $resourcePaths;
164164
 165+// Doesn't exist in 1.17, but declaring twice causes an error
 166+if ( version_compare( $wgVersion, '1.18', '<' ) ) {
 167+$wgResourceModules['jquery.form'] = array(
 168+ 'scripts' => 'js/jquery.form.js',
 169+) + $resourcePaths;
 170+}
 171+
165172 /** @endcond */
166173
167174
@@ -359,7 +366,7 @@
360367 '/^ext-collection/' => array( 'ext', 'collection' ),
361368 '/^ext-flaggedrevs/' => array( 'ext', 'flaggedrevs' ),
362369 '/^ext-readerfeedback/' => array( 'ext', 'readerfeedback' ),
363 - '/^ext-semantic/' => array( 'ext', 'semantic' ),
 370+ '/^ext-semantic/' => array( 'ext', 'semantic' ),
364371 '/^ext-socialprofile/' => array( 'ext', 'socialprofile' ),
365372 '/^ext-translate/' => array( 'ext', 'translate' ),
366373 '/^ext-uniwiki/' => array( 'ext', 'uniwiki' ),

Status & tagging log