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

#991 subtypes not filled in when editing a smart group #16541

Merged
merged 3 commits into from
May 24, 2020
Merged

#991 subtypes not filled in when editing a smart group #16541

merged 3 commits into from
May 24, 2020

Conversation

bhahumanists
Copy link
Contributor

https://lab.civicrm.org/dev/core/issues/991

Overview

Fixes contact subtypes not being carried over when editing a smart group created in Advanced Search.

Before

If you edit a smart group that contains a contact subtype (and it was created in Advanced Search), the subtype is not included in the form. Subsequent searches then ignore it. Similarly it's not included in the qill.

After

The contact subtype appears correctly.

Technical Details

N/A

Comments

This PR isn't a great fix as there's likely a better place for it, but I'm not sure where that would be. I can't put it in normalizeFormValues() as that doesn't run in this context, and there doesn't seem to be anywhere suitable in the preProcess.

@civibot
Copy link

civibot bot commented Feb 14, 2020

(Standard links)

@civibot civibot bot added the master label Feb 14, 2020
@eileenmcnaughton
Copy link
Contributor

@bhahumanists does this affect other search forms (contribution search etc). If not I'm OK with this as a location for the fix.

I feel like there was an issue in a previous attempt to fix this - maybe @jitendrapurohit or @pradpnayak remembers?

Note there is a style warning blocking jenkins - do you know about those?

@MegaphoneJon
Copy link
Contributor

The fix Eileen is referring to is #14373.

I did an r-run and confirm that this fixes core#991. There's a slight side effect that it will change the search very slightly by adding the contact type - e.g. searching for "contact subtype = Student" will become "contact type = Individual and contact subtype = Student". I was concerned about mixing contact subtypes across types - e.g. "Student" and "Team" only finding contacts who are both "Individual" and "Organization" - but this works as expected (Individual or Organization).

@MegaphoneJon
Copy link
Contributor

I just did a code review as well.

The code itself looks reasonable if we agree that this is the correct approach. @bhahumanists I read on the ticket that @scardinius doesn't experience this bug on "Find Contacts" search. If this problem doesn't exist on Search Builder either, I'd feel comfortable with the code going here and would recommend a merge-on-pass. I don't think can affect Contribution Search per Eileen's comment above because contact subtype isn't present on Contribution Search.

@eileenmcnaughton
Copy link
Contributor

test this pleasee

@eileenmcnaughton
Copy link
Contributor

I'm OK with a fix at this level & with merging this based on @MegaphoneJon 's review

@bhahumanists
Copy link
Contributor Author

I'll fix the whitespace issue (once I can figure out what it is, anyway)

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@colemanw
Copy link
Member

colemanw commented Mar 3, 2020

retest this please

@eileenmcnaughton
Copy link
Contributor

I think the fail relates

@yashodha
Copy link
Contributor

test this please

By checking if contact_type is empty
@bhahumanists
Copy link
Contributor Author

Updated. I don't think the fails relate now...?

@yashodha
Copy link
Contributor

@eileenmcnaughton is this ready to merge?

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@eileenmcnaughton eileenmcnaughton merged commit 9a910c3 into civicrm:master May 24, 2020
@bhahumanists bhahumanists deleted the subtype-issue-991 branch May 27, 2020 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants