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
$results = [];
- $rule->query($query);
+ $rule = CRM_Core_DAO::executeQuery($query);
while ($rule->fetch()) {
$results[$rule->id] = $rule->toArray();
AND acl.entity_table = 'civicrm_acl_role'
";
- $rule->query($query);
+ $rule = CRM_Core_DAO::executeQuery($query);
while ($rule->fetch()) {
$results[$rule->id] = $rule->toArray();
}
$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
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) {