From 30b0cb91dd9920578ce745c91edfec0c5f6fb67b Mon Sep 17 00:00:00 2001 From: monishdeb Date: Tue, 9 Sep 2014 12:46:57 +0530 Subject: [PATCH] CRM-14784 fix - The update greetings job times out without saving to the database https://issues.civicrm.org/jira/browse/CRM-14784 --- CRM/Contact/BAO/Contact/Utils.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index 67a0e1f903..5da54baa54 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -933,6 +933,8 @@ Group By componentId"; } if ($idFldName) { + $queryParams = array(1 => array($contactType, 'String')); + // if $force == 1 then update all contacts else only // those with NULL greeting or addressee value CRM-9476 if ($processAll) { @@ -948,10 +950,11 @@ Group By componentId"; } if ($limit) { - $sql .= " LIMIT $limit"; + $sql .= " LIMIT 0, %2"; + $queryParams += array(2 => array($limit, 'Integer')); } - $dao = CRM_Core_DAO::executeQuery($sql, array(1 => array($contactType, 'String'))); + $dao = CRM_Core_DAO::executeQuery($sql, $queryParams); while ($dao->fetch()) { $filterContactFldIds[$dao->id] = $dao->$idFldName; -- 2.25.1