ACL's causing invalid SQL
I've just been tracking down a problem where calls to CRM_Contact_BAO_Contact_Permission::allow()
result in a DB syntax error.
The problem is in CRM_ACL_BAO_ACL::getGroupClause()
see here.
$groupIDs
is set but only contains invalid or inactive groups, so the $foundGroupIDs
is empty resulting in the invalid SQL: ... WHERE group_id in ( ) AND ...