APIv3 call to GroupContact doesn't complete when using IN
Overview
There is a bug within APIv3 when making a 'GET' call to 'GroupContact', where the Contact ID is set and the Group ID uses 'IN'.
Reproduction steps
- Click on Support -> Developer -> API Explorer v3.
- Set Entity to GroupContact and Action to get
- Add two parameters:
- Group ID IN (select at least one group)
- Contact ID = (select a contact)
- Click Execute
- Note that nothing is returned, only a spinning/loading wheel
Current behaviour
A call to APIv3 where the Contact ID is set and the Group ID uses IN does not finish executing. This seems to be happening because the validation doesn't support an array and fails in php 8.1.
$result = civicrm_api3('GroupContact', 'get', [
'sequential' => 1,
'group_id' => ['IN' => ["Administrators"]],
'contact_id' => 203,
]);
Expected behaviour
The API call should be able to handle an arry and finish execution.
Environment information
- CiviCRM: 5.67.0, 5.69.alpha1