Skip to content

UR-4815 - Support Member Search by Full Name - #1391

Open
saurab018 wants to merge 1 commit into
developfrom
UR-4815-support-member-search-by-full-name
Open

UR-4815 - Support Member Search by Full Name#1391
saurab018 wants to merge 1 commit into
developfrom
UR-4815-support-member-search-by-full-name

Conversation

@saurab018

Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

Member search (User Registration → Members) already matched first_name, last_name, and nickname usermeta 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 like display_name.

Adds 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 ("John Smith") now matches when first/last are stored separately.
  • Full name search still matches when the name lives in a single field (e.g. display_name) — unchanged.
  • Searching an individual part ("John" or "Smith" alone) still matches — unchanged.
  • Purely additive OR condition; no existing behavior removed.

Closes UR-4815.

How to test the changes in this Pull Request:

  1. Go to User Registration → Members and edit/add a user whose display_name does 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.
  2. Search for the user's full name, e.g. John Smith — before this fix, no results; after, the user is found.
  3. Confirm searching just John or just Smith still finds the user.
  4. Confirm searching by email, username, or an already-matching display_name still works as before.

Types of changes:

  • Bug fix (non-breaking change which fixes an issue)

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully ran tests with your changes locally?
  • Have you updated the documentation accordingly?

Changelog entry

Fix: Member search now matches full name even when First Name and Last Name are stored as separate fields.

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.
@saurab018 saurab018 self-assigned this Aug 12, 2026
@lihsaa591

Copy link
Copy Markdown
Contributor

@tg-autopilot review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 an EXISTS subquery that matches CONCAT(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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants