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/core#394) : Wildcards are ignored in some smart group criteria, when the smart group is directly generated for a mailing #12910

Merged
merged 1 commit into from
Oct 10, 2018

Conversation

monishdeb
Copy link
Member

Overview

Steps to replicate:

  1. Create a text custom field used for Individual
  2. Choose any contact and add custom field value say 'abc'
  3. Go to Advance Search and search contact with criteria "custom field = '%a%'"
  4. Select the contact and choose task 'Email - schedule/send via CiviMail'
  5. Redirected to 'New Mailing' but with no recipient count

Before

screencast-before

After

screencast-after

Technical Details

As per the fix, we should first translate the formvalues in query format before saving the criteria for saved search which restores the operator and doesn't strip the wildcard which is essential, especially when such saved criteria are used by smart group. In addition, did a minor change to getRecipients() to ignore the cache_date of hidden smart groups for rebuilding its contact, as from UI there is no way we can rebuild recipients for such hidden smart group in other word cache_date is not updated.

@civibot
Copy link

civibot bot commented Oct 9, 2018

(Standard links)

@monishdeb
Copy link
Member Author

ping @lcdservices @colemanw

@lcdservices
Copy link
Contributor

Tested and confirmed this PR works as expected with the given test steps.

@eileenmcnaughton
Copy link
Contributor

@monishdeb test fail is related

Fatal error: Cannot use object of type CRM_Core_DAO_CustomField as array in /home/jenkins/bknix-dfl/build/core-12910-8xc5z/sites/all/modules/civicrm/tests/phpunit/CRM/Contact/BAO/GroupTest.php on line 251

GIving this merge on pass as once that is resolved then I'm happy with @lcdservices testing + unit test

@eileenmcnaughton
Copy link
Contributor

@monishdeb failing on a related e-notice

…when the smart group is directly generated for a mailing
@seamuslee001
Copy link
Contributor

Jenkins re test this please

@eileenmcnaughton
Copy link
Contributor

Test fails unrelated

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.

4 participants