-
Notifications
You must be signed in to change notification settings - Fork 638
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
[3.7]: Users native fields not applied in orderBy
param
#12241
Comments
orderBy
param
orderBy
paramorderBy
param
Thanks for reaching out! Unfortunately, I'm having some trouble replicating this one. Do you have any plugin or module code that could be altering the element query by chance? Are you able to determine what order they are actually being shown? I'm curious if the order they are showing in might offer any clues. |
@brianjhanson , I'm seeing this same issue on at least two sites, one of which has no module code at all. The two have some plugins in common, but nothing that should affect the Users in this way:
It seems that most of the Users are in something of an alphabetical order, but with more recent users first. At least one of the two sites had the Users imported, if that makes a difference? |
Any chance some of the imported users were accidentally imported with a space before the value? For example, imported as " Lastname" instead of "Lastname"? If not, could you send a database dump and your composer files over to [email protected] so I can dig deeper? |
@brianjhanson , I don't see any spaces before the value, no. I suppose it's possible, but I don't think that's very likely. I'll send over those files as soon as I can, though. Thanks for your help on this! |
Sounds like @olivierbon got you sorted out 🎉 For any wanderers ending up here in the future, this ended up being caused by multiple fields with the |
We just released Craft 4.3.2 which includes |
What happened?
Description
The
firstName
andlastName
Users native fields are not applied in theorderBy
parameter or in the Users element list view in the Control Panel.Steps to reproduce
Note: The following steps also apply to the native
firstName
field.lastName
field populated.lastName
. Example:{% set items = craft.users.orderBy('lastName asc').all() %}
Expected behavior
The expectation is that the list of Users will be output alphabetically, according to the
lastName
field.Actual behavior
The result is that the list of Users is not output alphabetically by lastName.
Craft CMS version
3.7.59 and 3.7.55.2
PHP version
8.0.24
Operating system and version
No response
Database type and version
mariadb:10.6
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: