r43562 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43561‎ | r43562 | r43563 >
Date:20:46, 15 November 2008
Author:ialex
Status:ok
Tags:
Comment:
\o/ finally found what caused that bug. Some arrays duplicated their items each time you saved a new version. This was due to the fact that WebConfiguration::initialise() was called two times, it will now restore the original "$this->settings" when calling it for the second time.
Modified paths:
  • /trunk/extensions/Configure/Configure.obj.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.obj.php
@@ -38,8 +38,14 @@
3939 public function initialise( $useCache = true ) {
4040 parent::initialise();
4141 $this->mConf = $this->mHandler->getCurrent( $useCache );
42 - $this->mOldSettings = $this->settings;
4342
 43+ # Restore first version of $this->settings if called a second time so
 44+ # that it doesn't duplicate arrays
 45+ if( !count( $this->mOldSettings ) )
 46+ $this->mOldSettings = $this->settings;
 47+ else
 48+ $this->settings = $this->mOldSettings;
 49+
4450 # We'll need to invert the order of keys as SiteConfiguration uses
4551 # $settings[$setting][$wiki] and the extension uses $settings[$wiki][$setting]
4652 foreach ( $this->mConf as $site => $settings ) {

Status & tagging log