Skip to content

edit user set fail flash adjustment #13070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- 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))
- 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))
- Fixed a bug where selecting an image with a transform within an asset selector modal wasn’t ever resolving.
- 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))
- Fixed XSS vulnerabilities.
- Updated yii2-debug to 2.1.22. ([#13058](https://github.com/craftcms/cms/issues/13058))

Expand Down
7 changes: 6 additions & 1 deletion src/controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,12 @@ public function actionActivateUser(): ?Response
public function actionEditUser(mixed $userId = null, ?User $user = null, ?array $errors = null): Response
{
if (!empty($errors)) {
$this->setFailFlash(implode(', ', reset($errors)));
$firstError = reset($errors);
if (is_array($firstError)) {
$this->setFailFlash(implode(', ', $firstError));
} else {
$this->setFailFlash($firstError);
}
}

// Determine which user account we're editing
Expand Down