[icinga-checkins] icinga.org: icingaweb2-module-director/master: DirectorDataField: preserve settings in fromDbRow

git at icinga.org git at icinga.org
Tue Dec 13 17:15:40 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 04f9b360da22e190df6ed187f86ec8ad036630f9
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=04f9b360da22e190df6ed187f86ec8ad036630f9

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue Dec 13 17:14:58 2016 +0100

DirectorDataField: preserve settings in fromDbRow

refs #13259

---

 library/Director/Objects/DirectorDatafield.php |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/library/Director/Objects/DirectorDatafield.php b/library/Director/Objects/DirectorDatafield.php
index 0120b17..bd23f4f 100644
--- a/library/Director/Objects/DirectorDatafield.php
+++ b/library/Director/Objects/DirectorDatafield.php
@@ -38,9 +38,14 @@ class DirectorDatafield extends DbObjectWithSettings
         // TODO: $obj->setUnmodified();
         $obj->hasBeenModified = false;
         $obj->modifiedProperties = array();
-
+        $settings = $obj->getSettings();
         // TODO: eventually prefetch
         $obj->onLoadFromDb();
+
+        // Restoring values eventually destroyed by onLoadFromDb
+        foreach ($settings as $key => $value) {
+            $obj->settings[$key] = $value;
+        }
         return $obj;
     }
 



More information about the icinga-checkins mailing list