Bug #9331: Only alter setting defaults if entry is in the same scope
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 22 Oct 2010 17:35:43 +0000 (11:35 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 22 Oct 2010 17:35:49 +0000 (11:35 -0600)
framework/Prefs/lib/Horde/Prefs.php

index 23da1cc..a9220d5 100644 (file)
@@ -561,10 +561,11 @@ class Horde_Prefs implements ArrayAccess
 
         if (($prefs = $this->_storage->get($scope)) !== false) {
             foreach ($prefs as $name => $val) {
-                if ($this->isDefault($name)) {
-                    $this->_scopes[$scope][$name]['d'] = $this->_scopes[$scope][$name]['v'];
-
-                } elseif (!isset($this->_scopes[$scope][$name])) {
+                if (isset($this->_scopes[$scope][$name])) {
+                    if ($this->isDefault($name)) {
+                        $this->_scopes[$scope][$name]['d'] = $this->_scopes[$scope][$name]['v'];
+                    }
+                } else {
                     $this->_scopes[$scope][$name] = array(
                         'm' => 0
                     );