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

nmalinoski created an issue. See original summary.

hass’s picture

Version: 7.x-1.2 » 8.x-1.x-dev
Category: Bug report » Feature request

This 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.

hass’s picture

hass’s picture

Component: Code » Documentation
Category: Feature request » Task

You can install https://www.drupal.org/project/admin_views and override the people view

Configure the view with:

  • Username column with Plain text formatter for not converting this field to Display Name
  • Add a new column based on the fields you typically use to construct your Display Name. I used Address (field) module and simply added the receipient (D8).

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.