CRM-18543 Deleting email address or phone of CiviMail recipient hangs job (#8355)
authorkenwest <ken.west@internode.on.net>
Fri, 30 Sep 2016 22:38:18 +0000 (08:38 +1000)
committercolemanw <coleman@civicrm.org>
Fri, 30 Sep 2016 22:38:18 +0000 (18:38 -0400)
* 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

index 9377e405f2acc89bcb707d0247fed0e8001afccd..c6e8b18c834162942325fbf2d3bc60a67a113ee2 100644 (file)
@@ -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";
         }