From e65ef4a07f15372a7681fb8d00f7fca15c310c3f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 3 Dec 2020 09:35:29 +0100 Subject: [PATCH] Clean up handling of user objects in UserEditForm --- .../files/lib/acp/form/UserEditForm.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php index ac99ae5531..359537b521 100755 --- a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php @@ -437,14 +437,16 @@ class UserEditForm extends UserAddForm { $this->objectAction = new UserAction([$this->userID], 'update', $data); $this->objectAction->executeAction(); + // reload user + $this->user = new UserEditor(new User($this->userID)); + // update user rank - $editor = new UserEditor(new User($this->userID)); if (MODULE_USER_RANK) { - $action = new UserProfileAction([$editor], 'updateUserRank'); + $action = new UserProfileAction([$this->user], 'updateUserRank'); $action->executeAction(); } if (MODULE_USERS_ONLINE) { - $action = new UserProfileAction([$editor], 'updateUserOnlineMarking'); + $action = new UserProfileAction([$this->user], 'updateUserOnlineMarking'); $action->executeAction(); } @@ -461,8 +463,8 @@ class UserEditForm extends UserAddForm { // reset password $this->password = $this->confirmPassword = ''; - // reload user when deleting the cover photo or disconnecting from 3rd party auth provider - if ($this->deleteCoverPhoto || $this->disconnect3rdParty) $this->user = new User($this->userID); + // reload user + $this->user = new UserEditor(new User($this->userID)); // show success message WCF::getTPL()->assign('success', true); -- 2.20.1