From 5c0a8f0a10cef30932eeb8cb4dc4045e0e86c82a Mon Sep 17 00:00:00 2001 From: dl617 Date: Tue, 2 Oct 2018 15:09:33 +0100 Subject: [PATCH] core/384 fix the the problem with not using a non-primary mobile number --- CRM/Mailing/BAO/Mailing.php | 1 - tests/phpunit/CRM/Mailing/BAO/MailingTest.php | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 1f0f0fa94f..035e513c35 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -235,7 +235,6 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing { 'location_filter' => CRM_Utils_SQL_Select::fragment()->where("$entityTable.phone_type_id = " . CRM_Core_PseudoConstant::getKey('CRM_Core_DAO_Phone', 'phone_type_id', 'Mobile')), 'phone_not_null' => CRM_Utils_SQL_Select::fragment()->where("$entityTable.phone IS NOT NULL"), 'phone_not_empty' => CRM_Utils_SQL_Select::fragment()->where("$entityTable.phone != ''"), - 'is_primary' => CRM_Utils_SQL_Select::fragment()->where("$entityTable.is_primary = 1"), 'mailing_id' => CRM_Utils_SQL_Select::fragment()->where("mg.mailing_id = #mailingID"), 'temp_contact_null' => CRM_Utils_SQL_Select::fragment()->where('temp.contact_id IS null'), 'order_by' => CRM_Utils_SQL_Select::fragment()->orderBy("$entityTable.is_primary = 1"), diff --git a/tests/phpunit/CRM/Mailing/BAO/MailingTest.php b/tests/phpunit/CRM/Mailing/BAO/MailingTest.php index 51685a063b..937babbf02 100644 --- a/tests/phpunit/CRM/Mailing/BAO/MailingTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/MailingTest.php @@ -413,7 +413,7 @@ class CRM_Mailing_BAO_MailingTest extends CiviUnitTestCase { public function testgetRecipientsSMS() { // Tests for SMS bulk mailing recipients // +CRM-21320 Ensure primary mobile number is selected over non-primary - // +CUDARW-905 Ensure that a secondary mobile number is selected if the primary can not receive SMS + // +core/384 Ensure that a secondary mobile number is selected if the primary can not receive SMS // Setup $smartGroupParams = array( @@ -485,7 +485,7 @@ class CRM_Mailing_BAO_MailingTest extends CiviUnitTestCase { 'is_primary' => 1, ))), ), - // Create primary that cant recieve SMS but a secondary that can, to test CUDARW-905 + // Create primary that cant recieve SMS but a secondary that can, to test core/384 $contactID3 => array( 'other_phone_id' => CRM_Utils_Array::value('id', $this->callAPISuccess('Phone', 'create', array( 'contact_id' => $contactID3, -- 2.25.1