From: kenwest Date: Fri, 30 Sep 2016 22:38:18 +0000 (+1000) Subject: CRM-18543 Deleting email address or phone of CiviMail recipient hangs job (#8355) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=81f62fdb3442151ecba7c08456d23ddc9ba0269b;p=civicrm-core.git CRM-18543 Deleting email address or phone of CiviMail recipient hangs job (#8355) * CRM-18543 Deleting email address or phone of CiviMail recipient causes job to hang * CRM-18543 Deleting email address or phone of CiviMail recipient causes job to hang --- diff --git a/CRM/Mailing/BAO/MailingJob.php b/CRM/Mailing/BAO/MailingJob.php index 9377e405f2..c6e8b18c83 100644 --- a/CRM/Mailing/BAO/MailingJob.php +++ b/CRM/Mailing/BAO/MailingJob.php @@ -450,6 +450,12 @@ VALUES (%1, %2, %3, %4, %5, %6, %7) $params = array(); $count = 0; while ($recipients->fetch()) { + // CRM-18543: there are situations when both the email and phone are null. + // Skip the recipient in this case. + if (empty($recipients->email_id) && empty($recipients->phone_id)) { + continue; + } + if ($recipients->phone_id) { $recipients->email_id = "null"; }