[icinga-checkins] icinga.org: icingaweb2-module-director/fiddle/mfrosch: IcingaObjectGroups: keep id when cloning groups

git at icinga.org git at icinga.org
Fri May 20 13:15:00 CEST 2016


Module: icingaweb2-module-director
Branch: fiddle/mfrosch
Commit: 1c798075000c9b0c6fa5360625fdf82247847d7a
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=1c798075000c9b0c6fa5360625fdf82247847d7a

Author: Thomas Gelf <thomas at gelf.net>
Date:   Fri May 20 08:47:07 2016 +0200

IcingaObjectGroups: keep id when cloning groups

Before this fix we lost autoincrement ids on clone, resulting in
ill-constructed queries on deletion

fixes #11508

---

 library/Director/Objects/IcingaObjectGroups.php |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/library/Director/Objects/IcingaObjectGroups.php b/library/Director/Objects/IcingaObjectGroups.php
index d3eb94b..7b5d292 100644
--- a/library/Director/Objects/IcingaObjectGroups.php
+++ b/library/Director/Objects/IcingaObjectGroups.php
@@ -304,7 +304,10 @@ class IcingaObjectGroups implements Iterator, Countable, IcingaConfigRenderer
         $this->storedGroups = array();
         foreach ($this->groups as $k => $v) {
             $this->storedGroups[$k] = clone($v);
+            $this->storedGroups[$k]->id = $v->id;
         }
+
+        $this->modified = false;
     }
 
     protected function getGroupClass()



More information about the icinga-checkins mailing list