From d0f057f40345ad1d6a02b034c3c1f965549cef6f Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 31 Oct 2016 22:09:23 +1300 Subject: [PATCH] Follow up fix on recently merged ACL cache code fix - this got missed --- CRM/Contact/BAO/Contact/Permission.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Contact/Permission.php b/CRM/Contact/BAO/Contact/Permission.php index ceb765cdad9d..1410c54d83c8 100644 --- a/CRM/Contact/BAO/Contact/Permission.php +++ b/CRM/Contact/BAO/Contact/Permission.php @@ -252,8 +252,8 @@ public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force // the permission clause. if (CRM_Core_Permission::check('edit my contact') || ($type == CRM_Core_Permission::VIEW && CRM_Core_Permission::check('view my contact'))) { - if (!CRM_Core_DAO::executeQuery(" - SELECT count(*) FROM civicrm_acl_contact_cache WHERE user_id = %1 AND contact_id = %1 AND operation = '{$operation}'", $queryParams)) { + if (!CRM_Core_DAO::singleValueQuery(" + SELECT count(*) FROM civicrm_acl_contact_cache WHERE user_id = %1 AND contact_id = %1 AND operation = '{$operation}' LIMIT 1", $queryParams)) { CRM_Core_DAO::executeQuery("INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(%1, %1, '{$operation}')"); } }