UR-4815 - Support Member Search by Full Name - #1391
Open
saurab018 wants to merge 1 commit into
Open
Conversation
Member search only matched first_name/last_name/nickname individually, so a full-name query (e.g. "John Smith") failed whenever the name was stored as separate first/last usermeta rather than combined into a single field like display_name. Add a concatenated first_name + last_name match (both orders) alongside the existing per-field checks in urm_search_user_on_name(), so full-name search works whether the name is split across two fields or stored as one, while single-word searches keep matching as before.
Contributor
|
@tg-autopilot review |
There was a problem hiding this comment.
Pull request overview
Adds support for member search queries that include a full name (e.g., “John Smith”) in the Members admin screen by matching against concatenated first_name/last_name usermeta combinations, while keeping existing per-field and core user table searches intact.
Changes:
- Extends
urm_search_user_on_name()to add anEXISTSsubquery that matchesCONCAT(first_name, ' ', last_name)and the reverse order. - Keeps existing search behavior for username, email, display name, nicename, and individual meta fields unchanged by adding the new logic as an additional OR condition.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Member search (User Registration → Members) already matched
first_name,last_name, andnicknameusermeta individually, but never checked them combined. So searching a full name (e.g. "John Smith") returned no results whenever the name was stored as separate first/last usermeta rather than combined into a single field likedisplay_name.Adds a concatenated
first_name + ' ' + last_namematch (both orders) alongside the existing per-field checks inurm_search_user_on_name(), so:display_name) — unchanged.Closes UR-4815.
How to test the changes in this Pull Request:
display_namedoes not already equal their full name (e.g. set "Display name publicly as" to the username), but who has First Name / Last Name set on their profile.John Smith— before this fix, no results; after, the user is found.Johnor justSmithstill finds the user.display_namestill works as before.Types of changes:
Other information:
Changelog entry