Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/report#59: Address location type search errors when using a search profile #19764

Merged
merged 2 commits into from
Mar 23, 2021

Conversation

monishdeb
Copy link
Member

@monishdeb monishdeb commented Mar 9, 2021

Overview

Steps to replicate the issue:

  1. Create a profile for use as a search view.
  2. Go to Advanced Search
  3. Trigger a search using that profile, and select an address location type.

Before

DB Error: no such field

After

No Error

Ref- https://lab.civicrm.org/dev/report/-/issues/59

ping @eileenmcnaughton @lcdservices @seamuslee001

@civibot
Copy link

civibot bot commented Mar 9, 2021

(Standard links)

@civibot civibot bot added the master label Mar 9, 2021
@eileenmcnaughton
Copy link
Contributor

Looks like the test needs updating to reflect this change - it handily makes the sql change very clear

CRM_Contact_SelectorTest::testSelectorQueryOnNonASCIIlocationType
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, `Non_ASCII_Location_Type-location_type`.id as `Non_ASCII_Location_Type-location_type_id`, `Non_ASCII_Location_Type-location_type`.name as `Non_ASCII_Location_Type-location_type`, `Non_ASCII_Location_Type-email`.id as `Non_ASCII_Location_Type-email_id`, `Non_ASCII_Location_Type-email`.email as `Non_ASCII_Location_Type-email`'
+'SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, `Non_ASCII_Location_Type-location_type`.id as `Non_ASCII_Location_Type-location_type_id`, `Non_ASCII_Location_Type-location_type`.name as `Non_ASCII_Location_Type-location_type`, `Non_ASCII_Location_Type-address`.id as `Non_ASCII_Location_Type-address_id`, `Non_ASCII_Location_Type-email`.id as `Non_ASCII_Location_Type-email_id`, `Non_ASCII_Location_Type-email`.email as `Non_ASCII_Location_Type-email`'```

@seamuslee001
Copy link
Contributor

@JoeMurray

@eileenmcnaughton
Copy link
Contributor

@monishdeb I'm having trouble replicating this - I think the config of the search profile might be part of the replication steps?

@seamuslee001
Copy link
Contributor

I was able to replicate this problem using the Search Profile containing the following fields:

  1. City - Primary
  2. Phone - Phone and Primary
  3. State Province field - Primary
  4. Address Name - Primary

Then perform a search where you filter by the address location type and it results in a DB error and I confirmed that this fixed it @eileenmcnaughton if you can double check this PR given my replication parts.

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 if you feel you have reviewed this go ahead & merge it

@seamuslee001
Copy link
Contributor

Merging as per @eileenmcnaughton 's comment

@seamuslee001 seamuslee001 merged commit 77c3b70 into civicrm:master Mar 23, 2021
@seamuslee001 seamuslee001 deleted the core-59 branch March 23, 2021 02:08
@mlutfy mlutfy changed the title core#59: Address location type search errors when using a search profile dev/report#59: Address location type search errors when using a search profile Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants