Skip to content

Commit cbbdfd7

Browse files
authored
Merge pull request #13070 from craftcms/bugfix/edit-user-set-fail-flash
edit user set fail flash adjustment
2 parents 02739c6 + 9e0b982 commit cbbdfd7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- Fixed a bug where it wasn’t possible to update a Matrix block on a revision without a new block ID being assigned. ([#13064](https://github.com/craftcms/cms/discussions/13064))
1717
- Fixed a JavaScript error that could occur on field layout designers, if any tabs didn’t have any elements. ([#13062](https://github.com/craftcms/cms/issues/13062))
1818
- Fixed a bug where selecting an image with a transform within an asset selector modal wasn’t ever resolving.
19+
- Fixed a PHP error that could occur if there was a problem sending a password-reset email. ([#13070](https://github.com/craftcms/cms/pull/13070))
1920
- Fixed XSS vulnerabilities.
2021
- Updated yii2-debug to 2.1.22. ([#13058](https://github.com/craftcms/cms/issues/13058))
2122

src/controllers/UsersController.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,12 @@ public function actionActivateUser(): ?Response
794794
public function actionEditUser(mixed $userId = null, ?User $user = null, ?array $errors = null): Response
795795
{
796796
if (!empty($errors)) {
797-
$this->setFailFlash(implode(', ', reset($errors)));
797+
$firstError = reset($errors);
798+
if (is_array($firstError)) {
799+
$this->setFailFlash(implode(', ', $firstError));
800+
} else {
801+
$this->setFailFlash($firstError);
802+
}
798803
}
799804

800805
// Determine which user account we're editing

0 commit comments

Comments
 (0)