Revision: 43562
Author:   ialex
Date:     2008-11-15 20:46:27 +0000 (Sat, 15 Nov 2008)

Log Message:
-----------
\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: trunk/extensions/Configure/Configure.obj.php
===================================================================
--- trunk/extensions/Configure/Configure.obj.php        2008-11-15 18:12:40 UTC 
(rev 43561)
+++ trunk/extensions/Configure/Configure.obj.php        2008-11-15 20:46:27 UTC 
(rev 43562)
@@ -38,8 +38,14 @@
        public function initialise( $useCache = true ) {
                parent::initialise();
                $this->mConf = $this->mHandler->getCurrent( $useCache );
-               $this->mOldSettings = $this->settings;
 
+               # Restore first version of $this->settings if called a second 
time so
+               # that it doesn't duplicate arrays
+               if( !count( $this->mOldSettings ) )
+                       $this->mOldSettings = $this->settings;
+               else
+                       $this->settings = $this->mOldSettings;
+                       
                # We'll need to invert the order of keys as SiteConfiguration 
uses
                # $settings[$setting][$wiki] and the extension uses 
$settings[$wiki][$setting]
                foreach ( $this->mConf as $site => $settings ) {



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to