Skip to content

empty username should be ordered as last#18731

Open
i-just wants to merge 1 commit into5.xfrom
bugfix/18723-prioritise-users-with-username
Open

empty username should be ordered as last#18731
i-just wants to merge 1 commit into5.xfrom
bugfix/18723-prioritise-users-with-username

Conversation

@i-just
Copy link
Copy Markdown
Contributor

@i-just i-just commented Apr 20, 2026

Description

Ensure that empty usernames are at the end of the sorted results. In other words, if you have usernames: abc, NULL, def and they’re all active, the default sort order should resolve to abc, def, NULL

Bit of history:

Steps to reproduce without involving Commerce:

  • login to CP
  • create a user with an empty username, and email of test@test.com
    • click “Create and set permissions”; don’t set permissions, don’t send activation email; exit to the user index page
  • create another user with username and email both set to test@test.com
    • click “Create and set permissions”
    • set permissions (at least access CP)
    • click “Save and send activation email”
    • activate that account
  • logout
  • try to log in as test@test.com

Without this PR, you won’t be able to log in, as the first returned user will be the inactive one (one without a username).

With this PR, you should be able to log in as the first returned user will be the active one (one with the username).

Related issues

#18723

@i-just i-just requested a review from brandonkelly April 20, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant