[icinga-checkins] icinga.org: icingaweb2-module-director/master: ObjectController: reasonable defaults for REST PUT

git at icinga.org git at icinga.org
Tue Feb 23 10:14:58 CET 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue Feb 23 09:09:10 2016 +0100

ObjectController: reasonable defaults for REST PUT

---

 library/Director/Web/Controller/ObjectController.php |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/library/Director/Web/Controller/ObjectController.php b/library/Director/Web/Controller/ObjectController.php
index 2a1863f..d138780 100644
--- a/library/Director/Web/Controller/ObjectController.php
+++ b/library/Director/Web/Controller/ObjectController.php
@@ -252,6 +252,13 @@ abstract class ObjectController extends ActionController
                     if ($request->getMethod() === 'POST') {
                         $object->setProperties($data);
                     } else {
+                        $data = array_merge(
+                            array(
+                                'object_type' => $object->object_type,
+                                'object_name' => $object->object_name
+                            ),
+                            $data
+                        );
                         $object->replaceWith(
                             IcingaObject::createByType($type, $data, $db)
                         );



More information about the icinga-checkins mailing list