r79366 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79365‎ | r79366 | r79367 >
Date:20:33, 31 December 2010
Author:catrope
Status:deferred
Tags:
Comment:
1.16wmf4: (bug 26194) Apply patch by Nx.devnull that prevents addModules() from running lots of times when LQT adds lots of toolbars
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php
@@ -10,6 +10,8 @@
1111
1212 /* Static Members */
1313
 14+ static $modulesAdded = false;
 15+
1416 static $scripts = array(
1517 'raw' => array(
1618 array( 'src' => 'Modules/Highlight/Highlight.js', 'version' => 5 ),
@@ -411,7 +413,11 @@
412414 */
413415 public static function addModules( &$toolbar ) {
414416 global $wgUser, $wgWikiEditorModules, $wgUsabilityInitiativeResourceMode;
415 -
 417+
 418+ if ( self::$modulesAdded ) {
 419+ return true;
 420+ }
 421+
416422 // Modules
417423 $preferences = array();
418424 $enabledModules = array();
@@ -470,6 +476,7 @@
471477 'wgWikiEditorPreferences' => $preferences,
472478 'wgWikiEditorEnabledModules' => $enabledModules,
473479 ) );
 480+ self::$modulesAdded = true;
474481 return true;
475482 }
476483

Status & tagging log