[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaCloneObjectForm: get cloned id AFTER store

git at icinga.org git at icinga.org
Wed Aug 24 16:49:51 CEST 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Aug 24 14:49:11 2016 +0000

IcingaCloneObjectForm: get cloned id AFTER store

fixes #11856

---

 application/forms/IcingaCloneObjectForm.php |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/application/forms/IcingaCloneObjectForm.php b/application/forms/IcingaCloneObjectForm.php
index 4fefb3f..45cb820 100644
--- a/application/forms/IcingaCloneObjectForm.php
+++ b/application/forms/IcingaCloneObjectForm.php
@@ -51,12 +51,12 @@ class IcingaCloneObjectForm extends QuickForm
             $object->getConnection()
         )->set('object_name', $newname);
 
-        $this->setSuccessUrl(
-            'director/' . strtolower($object->getShortTableName()),
-            $new->getUrlParams()
-        );
-
         if ($new->store()) {
+            $this->setSuccessUrl(
+                'director/' . strtolower($object->getShortTableName()),
+                $new->getUrlParams()
+            );
+
             $this->redirectOnSuccess($msg);
         } else {
             $this->redirectOnFailure($msg);



More information about the icinga-checkins mailing list