IcingaCloneObjectForm: fix redirection url

This commit is contained in:
Thomas Gelf 2016-03-20 11:38:19 +01:00
parent 343e5a8669
commit 5b9ba4e7e4
1 changed files with 5 additions and 5 deletions

View File

@ -39,11 +39,6 @@ class IcingaCloneObjectForm extends QuickForm
$newname = $this->getValue('new_object_name'); $newname = $this->getValue('new_object_name');
$resolve = $this->getValue('clone_type') === 'flat'; $resolve = $this->getValue('clone_type') === 'flat';
$this->setSuccessUrl(
'director/' . strtolower($object->getShortTableName()),
array('name' => $newname)
);
$msg = sprintf( $msg = sprintf(
'The %s "%s" has been cloned from "%s"', 'The %s "%s" has been cloned from "%s"',
$object->getShortTableName(), $object->getShortTableName(),
@ -56,6 +51,11 @@ class IcingaCloneObjectForm extends QuickForm
$object->getConnection() $object->getConnection()
)->set('object_name', $newname); )->set('object_name', $newname);
$this->setSuccessUrl(
'director/' . strtolower($object->getShortTableName()),
$new->getUrlParams()
);
if ($new->store()) { if ($new->store()) {
$this->redirectOnSuccess($msg); $this->redirectOnSuccess($msg);
} else { } else {