Skip to content
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 @@ -3,6 +3,7 @@
## Unreleased

- Fixed a bug where Matrix fields’ Entry Types settings were partially interactive when admin changes were disallowed. ([#18145](https://github.com/craftcms/cms/pull/18145))
- Fixed a bug where users could be unable to sign in if an inactive user account existed with the same email address. ([#18148](https://github.com/craftcms/cms/issues/18148))

## 5.8.21 - 2025-12-04

Expand Down
3 changes: 3 additions & 0 deletions src/services/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ public function getUserByUsernameOrEmail(string $usernameOrEmail): ?User
]);
}

// order by credentialed users first
$query->orderBy(['users.active' => SORT_DESC, 'users.pending' => SORT_DESC]);

/** @var User|null */
return $query->one();
}
Expand Down