Don't reset the config value if it's not set AND not the default.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 22 Sep 2010 21:00:57 +0000 (17:00 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 22 Sep 2010 21:00:57 +0000 (17:00 -0400)
Otherwise, we overwrite fields that are explicitly emptied with the previous values.

framework/Core/lib/Horde/Config.php

index c5269f8..b3e528c 100644 (file)
@@ -314,7 +314,10 @@ class Horde_Config
                 }
             } elseif (isset($configitem['_type'])) {
                 $val = $formvars->getExists($configname, $wasset);
-                if (!$wasset) {
+                if (!$wasset &&
+                    ((array_key_exists('is_default', $configitem) && $configitem['is_default'])
+                     || !array_key_exists('is_default', $configitem))) {
+
                     $val = isset($configitem['default']) ? $configitem['default'] : null;
                 }