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

CRM-21159: Address fields cause DB errors when adding contacts to group from Search Builder #11422

Merged
merged 2 commits into from
Jan 15, 2018

Conversation

ajesamson
Copy link
Contributor

@ajesamson ajesamson commented Dec 16, 2017

Overview

Fixes for problem with Address fields causing DB errors when adding contacts to group from Search Builder.
Alt text

Before

The "DB Error: no such field" screen appears directly after clicking or selecting "Group - add contacts." when the Search Builder is used to create a search that includes an address field ( State and Country)
Alt text

After

The page now loads properly with all required fields resolved.
Alt text

Technical Details

Join statement was missing in the generated query. Only reference to the table alias was added to the where clause.


@civicrm-builder
Copy link

Can one of the admins verify this patch?

@seamuslee001
Copy link
Contributor

Jenkins test this please

@eileenmcnaughton
Copy link
Contributor

This is a good fix that stalled due to lack of a unit test. However, I have just managed to replicate the bug in a unit test so I will submit that as a follow up to this.

The patch is limited in scope to 2 fields - state_province_id & country_id in the scenario where there might be multiple joins on the address table since search builder allows the selection of location type. I was concerned that it might be adding an unnecessary join but the address table is being joined in but not the country table (not required as the name has been resolved to an ID).

Merging

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.

4 participants