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

Show manually added Smart Groups on Contact edit #26521

Conversation

larssandergreen
Copy link
Contributor

@larssandergreen larssandergreen commented Jun 13, 2023

Before

Smart Groups to which a Contact has been manually added are not shown on Contact edit (the edit form, not the Contact Groups tab).

After

Manually added Smart Groups are shown - and Contacts can be removed from them.

@civibot
Copy link

civibot bot commented Jun 13, 2023

(Standard links)

@civibot civibot bot added the master label Jun 13, 2023
@seamuslee001
Copy link
Contributor

@johntwyman are you able to test this on the AUG instance for performance reasons?

@larssandergreen
Copy link
Contributor Author

@seamuslee001 This only touches group, group_contact and subscription_history, so I don't think we should see any significant performance issues. The difference is just not adding AND saved_search_id IS NULL to the query.

If you're concerned about smart group caching, this wouldn't touch that at all.

@colemanw
Copy link
Member

@larssandergreen will this cause the group to show up twice (once in the "Regular Groups" section and once under "Smart Groups")?

@larssandergreen
Copy link
Contributor Author

larssandergreen commented Jun 20, 2023

@colemanw This is just the edit form, not the contact groups tab, if that's what you're asking about (updated up top to clarify).

On the edit form, you only get non-smart groups currently, this PR would also show smart groups to which the contact has been manually added. Otherwise, we get inconsistencies, like the groups that show up on the contact groups tab, which include the manually-added smart groups, are different from the groups that show up on the edit form. Also, you can add a contact to a smart group on the edit form, but then if you save it and return to the form, that group doesn't appear in the list of groups even though the contact has actually been manually added.

It's already the case in core that these groups do show up twice on the contact groups tab, once in the regular groups, once in the smart groups. It's a bit weird, but then the manually-added to smart group thing is weird. I think it probably would make sense to remove them from the smart group listing, but that's out of scope here.

@colemanw
Copy link
Member

Ok that makes sense. Thanks.

@colemanw colemanw merged commit 1388cc0 into civicrm:master Jun 20, 2023
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