From dabb64f3df9d46279fccee141ec7fb9e99551b66 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 23 Mar 2021 13:29:45 +1300 Subject: [PATCH] Return from getACLRoles when contactID is null I've made this patch the least possible code wise to allow brain space to think about the query.... Basically the where is WHERE acl.entity_table='civicrm_acl_role'.... if contact_id is set it becomes AND acl.entity_table = 'civicrm_contact' Which means that it would only ever return empty results (once this is merged more cleanup can happen but I wanted to make this change easy to think through) --- CRM/ACL/BAO/ACL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index 64e5bc6e71..5927b87753 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -122,7 +122,7 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL { $where = ['acl.entity_table = "civicrm_acl_role" AND acl.entity_id IN (' . implode(',', array_keys(CRM_Core_OptionGroup::values('acl_role'))) . ')']; if (!empty($contact_id)) { - $where[] = " acl.entity_table = 'civicrm_contact' AND acl.is_active = 1 AND acl.entity_id = $contact_id"; + return []; } $results = []; -- 2.25.1