Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
Realname module cannot alter the user search query.
Proposed resolution
Add a query tag to core and extend the query by realname data.
Remaining tasks
- We must stop deleting the realname on user update as we need it all times or the search will fail. This is also required for views in a different case. #2022137: Always update realname on user updates, DONE
- In core the query in https://api.drupal.org/api/drupal/modules%21user%21user.module/function/... need to add a query tag e.g 'user_search'. Get #2116391: Tag user_search_execute() query for realname and other modules committed and add a query alter hook to realname module.
- Alter the core user search query and join the realname table.
User interface changes
None
API changes
None.
Related Issues
#2116391: Tag user_search_execute() query for realname and other modules
Original report by @bulldozer2003
When I do a user search, results are matched by the user ID and not the real name.
ex. I have two users "Tom Smith" and "Sally Smith" their user IDs are "tsmith" and "ssmith" respectively.
If I do a user search for "Tom" or "sally" I will get no results.
If I search for "smith" I will get both "Tom Smith" and "Sally Smith" as results.
If I search for "tsmith" I will get "Tom Smith" as a result.
Comments
Comment #1
C. Lee CreditAttribution: C. Lee commentedSame here
Comment #2
bulldozer2003Comment #3
C. Lee CreditAttribution: C. Lee commentedI heard that hidden fields are not indexed and now I'm only hiding the realname field by CSS. And still no luck.
Comment #4
C. Lee CreditAttribution: C. Lee commentedsorry
Comment #5
modreoci CreditAttribution: modreoci commentedThe same problem... It works in 6.x why not in 7.x?
Comment #6
mbosma CreditAttribution: mbosma commentedAny update on this? I'm still not getting real names to show up in search results.
Comment #7
almc CreditAttribution: almc commentedThe same issue seems to be in the current recommended release 7.x-1.1 of the module, installed with D7.23. Search is not done by user's real name and not configurable to do so. At the same time the ability to find a person by real name is very important if the real name functionality is decided as needed for a web site.
Comment #8
hass CreditAttribution: hass commentedFixed in #1722112: Autocomplete for entityreference fields. Please join.
Comment #9
almc CreditAttribution: almc commentedI've applied the patch realname_1722112+Autocomplete+for+entityreference+fields.patch from that thread and re-indexed the search but it doesn't seem to have helped with this issue. The search in User category is still done by a user name, not by real name.
Comment #10
hass CreditAttribution: hass commentedOh, i thought it means autocomplete fields... Reopening
I guess the realname is missing in the search index.
Comment #11
hass CreditAttribution: hass commentedOk, this is what need to be done to solve this issue here.
Comment #12
almc CreditAttribution: almc commentedThank you for the detailed insight, I may need to elaborate on the code although it would take much longer for me, would be great if the update for version 7 could come earlier, not diminishing importance of version 8 though, would be staying tuned ...
Comment #13
hass CreditAttribution: hass commentedHelp reviewing this core minor addition and set it to RTBC and it goes in... :-)))
Comment #14
almc CreditAttribution: almc commentedok, would be happy to help as much as I can ...
Comment #14.0
almc CreditAttribution: almc commenteda
Comment #15
hass CreditAttribution: hass commentedComment #16
hass CreditAttribution: hass commentedComment #17
hass CreditAttribution: hass commentedComment #18
hass CreditAttribution: hass commented