CRM-16936: Donor with only email address shows no display name
authoryashodha <yashodha.chaku@webaccessglobal.com>
Fri, 31 Jul 2015 08:01:08 +0000 (13:31 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Fri, 31 Jul 2015 08:01:08 +0000 (13:31 +0530)
----------------------------------------
* CRM-16936: Donor with only email address shows no display name
  https://issues.civicrm.org/jira/browse/CRM-16936

CRM/Contact/BAO/Contact.php

index c32b27d9a5c502c30c34e9792f324e8595003349..06cd9f22abe51b83d6f96b7fd82a3f1ee2cbe1e3 100644 (file)
@@ -2126,6 +2126,9 @@ ORDER BY civicrm_email.is_primary DESC";
         }
         elseif ($fieldName == 'email') {
           $data['email'][$loc]['email'] = $value;
+          if (empty($contactID)) {
+            $data['email'][$loc]['is_primary'] = 1;
+          }
         }
         elseif ($fieldName == 'im') {
           if (isset($params[$key . '-provider_id'])) {