From a39ef8af08f176c94c1bfc64194e44f9dace4c8e Mon Sep 17 00:00:00 2001 From: Eileen Date: Thu, 19 Dec 2013 17:01:10 +1300 Subject: [PATCH] CRM-14008 alter update greeting to update blanks as well as null ---------------------------------------- * CRM-14008: Addressee greetings not being updated when they are empty http://issues.civicrm.org/jira/browse/CRM-14008 --- CRM/Contact/BAO/Contact/Utils.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index 5f3e9a37f0..7a5556547e 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -989,8 +989,12 @@ Group By componentId"; $sql = "SELECT DISTINCT id, $idFldName FROM civicrm_contact WHERE contact_type = %1 "; } else { - $sql = "SELECT DISTINCT id, $idFldName FROM civicrm_contact WHERE contact_type = %1 - AND ( {$idFldName} IS NULL OR ( {$idFldName} IS NOT NULL AND {$displayFldName} IS NULL ) ) "; + $sql = " + SELECT DISTINCT id, $idFldName + FROM civicrm_contact + WHERE contact_type = %1 + AND ({$idFldName} IS NULL + OR ( {$idFldName} IS NOT NULL AND ({$displayFldName} IS NULL OR {$displayFldName} = '')) )"; } $dao = CRM_Core_DAO::executeQuery($sql, array(1 => array($contactType, 'String'))); -- 2.25.1