Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When sorting by username on the People page (The site's user listing), the list gets sorted by the raw username while showing the Real Name override. This gives the user list the appearance that it's not being sorted properly.
I would have expected it to sort by what's being displayed; is it possible to hook into the user list before it gets sorted?
Alternatively, can the user list be overridden to add a separate column for Real Name while leaving Username untouched?
Comments
Comment #2
hass CreditAttribution: hass commentedThis query is inside D7 user_admin_account() function and the query is not tagged. This means we cannot alter it :-(. First of all core need to add a querytag and than we can alter it in realname module. Feel free to share patches for both realname and core.
Moving to D8 as I have not checked D8 core if the query is tagged. In D8 it is a view, but it is also not correctly sorted by display name.
Comment #3
hass CreditAttribution: hass commentedComment #4
hass CreditAttribution: hass commentedYou can install https://www.drupal.org/project/admin_views and override the people view
Configure the view with:
I think this worth a documentation page as realname cannot prepare for this as Display Names can be constructed from everything and we cannot guess from what fields. Some may use address module, others use custom firstname/lastname fields and so on.