Skip to content

Fix customer email search missing primary-email-only customers - #9831

Open
anisur2805 wants to merge 1 commit into
awesomemotive:mainfrom
anisur2805:fix/9825-customer-email-search-fallback
Open

Fix customer email search missing primary-email-only customers#9831
anisur2805 wants to merge 1 commit into
awesomemotive:mainfrom
anisur2805:fix/9825-customer-email-search-fallback

Conversation

@anisur2805

Copy link
Copy Markdown

Searching Downloads > Customers by a full email address only queried the edd_customer_email_addresses table. A customer whose email is stored in edd_customers.email but has no matching row in that table returned no results, even though a partial/domain search found them.

Add a fallback that runs only when the email-addresses lookup returns nothing: look the customer up by the primary email column via get_item_by( 'email', ... ). This matches the customers table directly, unlike the Customer query 'email' argument which parse_query_for_emails() reroutes to the email addresses table.

Fixes #9825

Searching Downloads > Customers by a full email address only queried
the edd_customer_email_addresses table. A customer whose email is stored
in edd_customers.email but has no matching row in that table returned no
results, even though a partial/domain search found them.

Add a fallback that runs only when the email-addresses lookup returns
nothing: look the customer up by the primary email column via
get_item_by( 'email', ... ). This matches the customers table directly,
unlike the Customer query 'email' argument which parse_query_for_emails()
reroutes to the email addresses table.

Fixes awesomemotive#9825
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.

Customer email search misses customers without customer email address rows

1 participant