From 81f62fdb3442151ecba7c08456d23ddc9ba0269b Mon Sep 17 00:00:00 2001 From: kenwest Date: Sat, 1 Oct 2016 08:38:18 +1000 Subject: [PATCH] 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 --- CRM/Mailing/BAO/MailingJob.php | 6 ++++++ 1 file changed, 6 insertions(+) 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"; } -- 2.25.1