r60316 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60315‎ | r60316 | r60317 >
Date:15:01, 23 December 2009
Author:catrope
Status:deferred
Tags:
Comment:
UsabilityInitiative: (bug 21459) Handle 'user' => false in config correctly
Modified paths:
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php
@@ -138,7 +138,11 @@
139139 foreach ( $wgVectorModules as $module => $enable ) {
140140 if ( isset( self::$modules[$module]['i18n'], self::$modules[$module]['preferences'] ) ) {
141141 wfLoadExtensionMessages( self::$modules[$module]['i18n'] );
142 - foreach ( self::$modules[$module]['preferences'] as $preference ) {
 142+ foreach ( self::$modules[$module]['preferences'] as $key => $preference ) {
 143+ if ( $key == 'enable' && !$enable['user'] ) {
 144+ continue;
 145+ }
 146+
143147 // The preference with the key 'enable' determines if the rest are even relevant, so in the future
144148 // setting up some dependencies on that might make sense
145149 $defaultPreferences[$preference['key']] = $preference['ui'];
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php
@@ -422,7 +422,11 @@
423423 foreach ( $wgWikiEditorModules as $module => $enable ) {
424424 if ( isset( self::$modules[$module]['i18n'], self::$modules[$module]['preferences'] ) ) {
425425 wfLoadExtensionMessages( self::$modules[$module]['i18n'] );
426 - foreach ( self::$modules[$module]['preferences'] as $preference ) {
 426+ foreach ( self::$modules[$module]['preferences'] as $key => $preference ) {
 427+ if ( $key == 'enable' && !$enable['user'] ) {
 428+ continue;
 429+ }
 430+
427431 // The preference with the key 'enable' determines if the rest are even relevant, so in the future
428432 // setting up some dependencies on that might make sense
429433 $defaultPreferences[$preference['key']] = $preference['ui'];

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r58991UsabilityInitiative: (bug 21459) WikiEditor breaks when NTOC disabled. This i...catrope00:01, 13 November 2009

Status & tagging log