From 1d9020305161093565b699ed16a400b242162199 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 14 Feb 2019 18:37:14 +1300 Subject: [PATCH] Fix regression on refreshing group_contact cache before checking acls We seem to be checking if the cache needs a rebuild and IF SO doing 2 actions 1) rebuilding it 2) permitting access to contacts related to it When really it should do only 1) above - this patch changes as such This seems to be whackamole off https://github.com/civicrm/civicrm-core/pull/12344 going too far one way & https://github.com/civicrm/civicrm-core/pull/13448 fixing but adding this new variant --- CRM/ACL/BAO/ACL.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index f74f1c6026..8e6d14ffb1 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -782,10 +782,10 @@ SELECT g.* while ($dao->fetch()) { $groupIDs[] = $dao->id; - if (($dao->saved_search_id || $dao->children || $dao->parents) && - $dao->cache_date == NULL - ) { - CRM_Contact_BAO_GroupContactCache::load($dao); + if (($dao->saved_search_id || $dao->children || $dao->parents)) { + if ($dao->cache_date == NULL) { + CRM_Contact_BAO_GroupContactCache::load($dao); + } $groupContactCacheClause = " UNION SELECT contact_id FROM civicrm_group_contact_cache WHERE group_id IN (" . implode(', ', $groupIDs) . ")"; } -- 2.25.1