Opened 2 years ago
Closed 5 weeks ago
#16366 closed enhancement (fixed)
Search Users box on ms-users.php doesn't search all fields
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Network Admin | Version: | 3.0.4 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | aren@…, 24-7@…, pippin@… |
Description
The Search Users box on ms-users.php isn't working for valid search terms.
I have a user with these fields:
Username: 12345678 (it's from our LDAP provider)
Name: Smith, John (again, convoluted, but it's from LDAP)
E-mail: john@…
What actually happens: If I search on smith or john smith, I get no results. But if I search on john, I see his account.
What should happen: All three of those search terms should have showed John Smith's account.
Attachments (3)
Change History (19)
comment:1
SergeyBiryukov — 2 years ago
What actually happens: If I search on smith or john smith, I get no results. But if I search on john, I see his account.
I think "john" is the user_nicename. WP_User_Query doesn't search for display_name that is why "smith" and "john smith" return zero results.
This won't scale as there is no index on the column in the database.
Therefore this isn't suitable for core - we could probably add a filter on the array of columns instead so you can add them if you want and don't care about the possibly deadly slow queries.
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
comment:7
novasource — 2 years ago
- Resolution wontfix deleted
- Status changed from closed to reopened
Hold on a sec. Where's the feature request for westi's comment above?
SergeyBiryukov — 2 years ago
comment:8
SergeyBiryukov — 2 years ago
Added patch with a filter.
- Milestone set to Future Release
- Type changed from defect (bug) to enhancement
comment:10
F J Kaiser — 2 years ago
- Cc 24-7@… added
comment:11
mordauk — 8 months ago
- Cc pippin@… added
comment:12
SergeyBiryukov — 7 months ago
#22309 was marked as a duplicate.
comment:13
aaroncampbell — 7 weeks ago
This filter would be really nice to have. The argument westi made of not having an index on certain columns makes sense, but should also apply to user_email and user_url...both of which have since been added to the allowed list which is now:
array( 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename' )
Also, it's relatively easy for a specific site to add the necessary index if it's something they need.
+1 for adding the user_search_columns filter
comment:14
SergeyBiryukov — 7 weeks ago
- Milestone changed from Future Release to 3.6
comment:15
SergeyBiryukov — 7 weeks ago
- Keywords commit added
comment:16
nacin — 5 weeks ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from reopened to closed
In 24056:

Related: #16014