Skip to content

Commit

Permalink
Only call getGroupACLRoles if contactID is present
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Mar 24, 2021
1 parent 9d64793 commit ae5a11c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions CRM/ACL/BAO/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public static function operation(): array {
* Array of assoc. arrays of ACL rules
* @throws \CRM_Core_Exception
*/
protected static function getGroupACLRoles($contact_id) {
$contact_id = CRM_Utils_Type::escape($contact_id, 'Integer');
protected static function getGroupACLRoles(int $contact_id) {

$query = " SELECT acl.*
FROM civicrm_acl acl
Expand Down Expand Up @@ -141,8 +140,8 @@ public static function getAllByContact(?int $contact_id): array {
while ($rule->fetch()) {
$result[$rule->id] = $rule->toArray();
}
$result += self::getGroupACLRoles($contact_id);
}
$result += self::getGroupACLRoles($contact_id);
return $result;
}

Expand Down

0 comments on commit ae5a11c

Please sign in to comment.