From 62ef44d1259c8bdf6bf1bc49e460f97c0978df44 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 9 Oct 2013 17:05:37 +0200 Subject: [PATCH] Fixes name of edited group in group dropdown menu --- .../install/files/acp/templates/userGroupAdd.tpl | 2 +- .../files/lib/acp/form/UserGroupEditForm.class.php | 5 +++++ .../files/lib/data/user/group/UserGroup.class.php | 12 ++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/acp/templates/userGroupAdd.tpl b/wcfsetup/install/files/acp/templates/userGroupAdd.tpl index 9a27edbfdd..a771e38ea3 100644 --- a/wcfsetup/install/files/acp/templates/userGroupAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userGroupAdd.tpl @@ -32,7 +32,7 @@ diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php index c58e84af54..b2b9cf8fbb 100755 --- a/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php @@ -131,9 +131,14 @@ class UserGroupEditForm extends UserGroupAddForm { if (I18nHandler::getInstance()->isPlainValue('groupName')) { I18nHandler::getInstance()->remove($this->groupName); $this->groupName = I18nHandler::getInstance()->getValue('groupName'); + + UserGroup::getGroupByID($this->groupID)->setName($this->groupName); } else { I18nHandler::getInstance()->save('groupName', $this->groupName, 'wcf.acp.group', 1); + + $groupNames = I18nHandler::getInstance()->getValues('groupName'); + UserGroup::getGroupByID($this->groupID)->setName($groupNames[WCF::getLanguage()->languageID]); } $this->groupDescription = 'wcf.acp.group.groupDescription'.$this->group->groupID; if (I18nHandler::getInstance()->isPlainValue('groupDescription')) { diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php index ed50757344..bf99256946 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php @@ -248,6 +248,18 @@ class UserGroup extends DatabaseObject { return WCF::getLanguage()->get($this->groupName); } + /** + * Sets the name of this user group. + * + * This method is only needed to set the current name of it has been changed + * in the same request. + * + * @param string $name + */ + public function setName($name) { + $this->data['groupName'] = $name; + } + /** * Returns true if current user may delete this group. * -- 2.20.1