r45976 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45975‎ | r45976 | r45977 >
Date:20:57, 21 January 2009
Author:ialex
Status:deferred
Tags:
Comment:
Backport r45967, r45968 and r45975
Modified paths:
  • /branches/REL1_14/extensions/Configure/CHANGELOG (modified) (history)
  • /branches/REL1_14/extensions/Configure/Configure.obj.php (modified) (history)
  • /branches/REL1_14/extensions/Configure/Configure.page.php (modified) (history)
  • /branches/REL1_14/extensions/Configure/Configure.php (modified) (history)
  • /branches/REL1_14/extensions/Configure/Configure.settings.php (modified) (history)
  • /branches/REL1_14/extensions/Configure/SpecialExtensions.php (modified) (history)

Diff [purge]

Index: branches/REL1_14/extensions/Configure/Configure.obj.php
@@ -84,7 +84,7 @@
8585 if( !is_array( $this->mDefaults ) ) {
8686 $this->mDefaults = array();
8787 }
88 - $allSettings = ConfigurationSettings::singleton( CONF_SETTINGS_BOTH )->getEditableSettings();
 88+ $allSettings = ConfigurationSettings::singleton( CONF_SETTINGS_CORE )->getEditableSettings();
8989 $allSettings += array_flip( $alwaysSnapshot );
9090 foreach( $allSettings as $setting => $type ) {
9191 if( array_key_exists( $setting, $GLOBALS ) &&
Index: branches/REL1_14/extensions/Configure/Configure.page.php
@@ -125,7 +125,7 @@
126126 protected function getSettingValue( $setting ) {
127127 static $defaults;
128128
129 - if (!$defaults) {
 129+ if ( !$defaults ) {
130130 global $wgConf;
131131 $defaults = $wgConf->getDefaultsForWiki( $this->mWiki );
132132 }
Index: branches/REL1_14/extensions/Configure/CHANGELOG
@@ -1,6 +1,10 @@
22 This file lists changes on this extension.
33 Localisation updates are done on betawiki and aren't listed here.
44
 5+1.14 branch-3 - 21 January 2009
 6+ Fixed a bug on Special:Extensions, default settings values are now correctly
 7+ displayed.
 8+
59 1.14 branch-2 - 17 January 2009
610 Fixed "You are not allowed to read this setting" error for all settings on
711 Special:Extensions when $wgConfigureEditableSettings is an non-empty array.
Index: branches/REL1_14/extensions/Configure/Configure.settings.php
@@ -194,7 +194,8 @@
195195 global $wgConf, $wgConfigureNotEditableSettings, $wgConfigureEditableSettings;
196196 $notEditable = array_merge( $notEditable, $wgConf->getUneditableSettings() );
197197
198 - if ( !count( $wgConfigureNotEditableSettings ) && count( $wgConfigureEditableSettings ) ) {
 198+ if ( !count( $wgConfigureNotEditableSettings ) && count( $wgConfigureEditableSettings ) &&
 199+ ( $this->types & CONF_SETTINGS_CORE ) == CONF_SETTINGS_CORE ) {
199200 // Only disallow core settings, not extensions settings!
200201 $coreSettings = array();
201202 foreach( $this->settings as $section ) {
@@ -230,6 +231,12 @@
231232 foreach( $wgConfigureEditableSettings as $setting ) {
232233 $this->cache['editable'][$setting] = $this->getSettingType( $setting );
233234 }
 235+ // We'll need to add extensions settings
 236+ if ( ( $this->types & CONF_SETTINGS_EXT ) == CONF_SETTINGS_EXT ) {
 237+ foreach ( $this->getAllExtensionsObjects() as $ext ) {
 238+ $this->cache['editable'] += $ext->getSettings();
 239+ }
 240+ }
234241 return $this->cache['editable'];
235242 }
236243
Index: branches/REL1_14/extensions/Configure/Configure.php
@@ -17,7 +17,7 @@
1818 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure',
1919 'description' => 'Allow authorised users to configure the wiki via a web-based interface',
2020 'descriptionmsg' => 'configure-desc',
21 - 'version' => '0.11.5 (1.14 branch-2)',
 21+ 'version' => '0.11.5 (1.14 branch-3)',
2222 );
2323
2424 # Configuration part
Index: branches/REL1_14/extensions/Configure/SpecialExtensions.php
@@ -96,7 +96,8 @@
9797 if( !$ext->isInstalled() ) continue; // must exist
9898 $settings = $ext->getSettings();
9999 foreach ( $settings as $setting => $type ) {
100 - if ( !isset( $GLOBALS[$setting] ) && !isset( $this->conf[$setting] ) && file_exists( $ext->getFile() ) ) {
 100+ if ( !isset( $this->conf[$setting] ) && file_exists( $ext->getFile() ) ) {
 101+ //echo "$setting<br/>\n";
101102 if ( !$globalDone ) {
102103 extract( $GLOBALS, EXTR_REFS );
103104 global $wgHooks;
@@ -105,14 +106,14 @@
106107 $globalDone = true;
107108 }
108109 require_once( $ext->getFile() );
109 - if ( isset( $GLOBALS[$setting] ) )
110 - $this->conf[$setting] = $GLOBALS[$setting];
 110+ if ( isset( $$setting ) )
 111+ $this->conf[$setting] = $$setting;
111112 }
112113 }
113114 $ext->setPageObj( $this );
114115 $ret .= $ext->getHtml();
115116 }
116 - if ( isset( $oldHooks ) )
 117+ if ( $globalDone )
117118 $GLOBALS['wgHooks'] = $oldHooks;
118119 return $ret;
119120 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45967Fixed a bug on Special:Extensions, default settings values are now correctly ...ialex16:07, 21 January 2009
r45968* Fix for r45967, include extensions settings in ConfigurationSettings::getEd...ialex19:50, 21 January 2009
r45975removed now useless checkialex20:56, 21 January 2009

Status & tagging log