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-18656 Advanced search fails to show tagset criteria #8432

Closed
wants to merge 2 commits into from

Conversation

kenwest
Copy link
Contributor

@kenwest kenwest commented May 23, 2016

When editing a saved search, tagset criteria don't show.

This occurs because on the form the tagsets are displayed separately to other tags, while in the saved search they are all stored together. When retrieved from the saved search, the tagset tags need to be separated again.

The function that 'normalises' the tags so they are all stored together in the saved search is CRM_Contact_Form_Search_Advanced::normalizeFormValues(). On the form, normal tags are stored in an element named 'contact_tags' while tagset tags are stored in elements named 'contact_taglist[23]' where '23' is the Id of the tagset. normalizeFormValues() converts them all to parameters with name 'contact_tags' (the queries can use the IN operator on all the tag values: they don't care about tagsets).

What's needed is some code that reverses this. This patch ...

  1. Does no harm if the $defaults don't need this processing
  2. Looks at each 'contact_tags' default to see if it is a tagset tag
  3. If it is, move the 'contact_tags' element to an array like 'contact_taglist[23]'
  4. Cleans up the 'contact_tags' array

@colemanw
Copy link
Member

@kenwest the stylechecker says:

Advanced.php:403 - There should be no white space after an opening "{"

@jitendrapurohit
Copy link
Contributor

cherry-picked the commits and created a new PR at #8596 with little optimisation.

@monishdeb
Copy link
Member

Closing in favor of #8596

@monishdeb monishdeb closed this Jun 20, 2016
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.

5 participants