CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • "Include / Exclude Contacts in a Group / Tag" search broken with CiviMail
Pages: [1]

Author Topic: "Include / Exclude Contacts in a Group / Tag" search broken with CiviMail  (Read 2336 times)

tmcnulty1982

  • Guest
"Include / Exclude Contacts in a Group / Tag" search broken with CiviMail
December 12, 2008, 08:06:10 am
I wrote a custom search based on the "Include / Exclude Contacts in a Group / Tag" custom search that ships with CiviCRM 2.1.2.

It works great when searching and I can even save the search as a smart group and it still works when I come back to look at the members.

However, I get a database error when I try to send a mailing to the smart group via CiviMail.  At first I thought it was my error, but the original custom search has the same problem as well:

Code: [Select]
Database Error Code: Table 'civicrm_demo_drupal.Ig_civicrm_temp_custom_7708a8c4fe8462374d3904f2b860a883' doesn't exist, 1146

I reproduced it on the demo site; just try to send a mailing to the 'toby cs' group.

What is missing?  Is the model of creating the temporary table causing trouble with CiviMail?  If I rewrote the search to call the sql manually every time, instead of caching the results in a temporary table, would that fix it?  Or is there a simpler change I could make so that it works in CiviMail?

Thanks
Toby

tmcnulty1982

  • Guest
Re: "Include / Exclude Contacts in a Group / Tag" search broken with CiviMail
December 12, 2008, 08:54:34 am
For what it's worth I managed to get around this with 2 small changes to the Group.php custom search.  The problems were (a) all() didn't get called by civimail, so certain crucial initializations didn't take place; and (b) it did not join on the civicrm_email table.  The fix for (a) just involved moving said initializations to the constructor and for (b) a simple LEFT JOIN.

See attached patch for proposed fix.  This has been successfully tested on CiviCRM 2.1.2.
« Last Edit: December 12, 2008, 10:24:30 am by tmcnulty1982 »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "Include / Exclude Contacts in a Group / Tag" search broken with CiviMail
December 12, 2008, 09:26:27 am

thanx

patched for 2.1.3

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

tmcnulty1982

  • Guest
Re: "Include / Exclude Contacts in a Group / Tag" search broken with CiviMail
December 12, 2008, 10:26:48 am
*UPDATE* I modified the above patch to return the bulk and/or primary email instead of all of them.  Thanks for the suggestion lobo.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • "Include / Exclude Contacts in a Group / Tag" search broken with CiviMail

This forum was archived on 2017-11-26.