X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FACL%2FBAO%2FACL.php;h=f1f8cb0df8a1c67f51fb2bc348cde8620f1d7dad;hb=d1eed91c218f4c285a535275e36732f68463824b;hp=873e6d55b7a7632900408e0d2b1eddb102c4e3f3;hpb=e6ac8b253e7c321dc2f5ced965de48b616c20275;p=civicrm-core.git diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index 873e6d55b7..f1f8cb0df8 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -204,8 +204,6 @@ SELECT acl.* protected static function getGroupACLRoles($contact_id) { $contact_id = CRM_Utils_Type::escape($contact_id, 'Integer'); - $rule = new CRM_ACL_BAO_ACL(); - $query = " SELECT acl.* FROM civicrm_acl acl INNER JOIN civicrm_option_group og @@ -228,7 +226,7 @@ SELECT acl.* $results = []; - $rule->query($query); + $rule = CRM_Core_DAO::executeQuery($query); while ($rule->fetch()) { $results[$rule->id] = $rule->toArray(); @@ -249,7 +247,7 @@ SELECT acl.* AND acl.entity_table = 'civicrm_acl_role' "; - $rule->query($query); + $rule = CRM_Core_DAO::executeQuery($query); while ($rule->fetch()) { $results[$rule->id] = $rule->toArray(); } @@ -479,10 +477,10 @@ SELECT g.* $aclKeys = array_keys($acls); $aclKeys = implode(',', $aclKeys); - $cacheKey = CRM_Utils_Cache::cleanKey("$tableName-$aclKeys"); + $cacheKey = CRM_Utils_Cache::cleanKey("$type-$tableName-$aclKeys"); $cache = CRM_Utils_Cache::singleton(); $ids = $cache->get($cacheKey); - if (!$ids) { + if (!is_array($ids)) { $ids = []; $query = " SELECT a.operation, a.object_id @@ -520,6 +518,8 @@ ORDER BY a.object_id if (empty($ids) && !empty($includedGroups) && is_array($includedGroups) ) { + // This is pretty alarming - we 'sometimes' include all included groups + // seems problematic per https://lab.civicrm.org/dev/core/-/issues/1879 $ids = $includedGroups; } if ($contactID) {