From: Tim Düsterhus Date: Thu, 3 Dec 2020 08:35:29 +0000 (+0100) Subject: Clean up handling of user objects in UserEditForm X-Git-Tag: 5.4.0_Alpha_1~555^2~8^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e65ef4a07f15372a7681fb8d00f7fca15c310c3f;p=GitHub%2FWoltLab%2FWCF.git Clean up handling of user objects in UserEditForm --- 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);