From f3124ffd591a3eb285be9e6d45df6fea360ee54f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 22 May 2015 17:03:02 +0200 Subject: [PATCH] UserGroupForm: Fix redirect when renaming a group refs #8826 --- application/forms/Config/UserGroupForm.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/application/forms/Config/UserGroupForm.php b/application/forms/Config/UserGroupForm.php index 80a48643f..b2ac015e4 100644 --- a/application/forms/Config/UserGroupForm.php +++ b/application/forms/Config/UserGroupForm.php @@ -33,6 +33,24 @@ class UserGroupForm extends RepositoryForm } } + /** + * Update a group + * + * @return bool + */ + protected function onUpdateSuccess() + { + if (parent::onUpdateSuccess()) { + if (($newName = $this->getValue('group_name')) !== $this->getIdentifier()) { + $this->getRedirectUrl()->setParam('group', $newName); + } + + return true; + } + + return false; + } + /** * Create and add elements to this form to delete a group *