From 3d41f850a437ba4cd8984475711904274913119b Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Sat, 2 Mar 2013 14:09:57 -0800 Subject: [PATCH] fix CRM-12003 --- CRM/Contact/Form/Task/EmailCommon.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index dcfcbc8492..47f4ce88ee 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -71,10 +71,8 @@ class CRM_Contact_Form_Task_EmailCommon { foreach ($contactEmails as $emailId => $item) { $email = $item['email']; - if (!$email && - (count($emails) <= 1) - ) { - $emails[$emailId] = '"' . $fromDisplayName . '"'; + if (!$email && (count($emails) < 1)) { + // set it if no emails are present at all $form->_noEmails = TRUE; } else { @@ -86,11 +84,11 @@ class CRM_Contact_Form_Task_EmailCommon { $emails[$emailId] = '"' . $fromDisplayName . '" <' . $email . '> '; $form->_onHold[$emailId] = $item['on_hold']; + $form->_noEmails = FALSE; } } $form->_emails[$emailId] = $emails[$emailId]; - $emails[$emailId] .= $item['locationType']; if ($item['is_primary']) { @@ -99,6 +97,8 @@ class CRM_Contact_Form_Task_EmailCommon { $emails[$emailId] = htmlspecialchars($emails[$emailId]); } + CRM_Core_Error::debug($form->_noEmails, $emails); exit(); + $form->assign('noEmails', $form->_noEmails); if ($form->_noEmails) { -- 2.25.1