SearchKit: "Error: Cannot use a scalar value as an array" on some rewrites
This is a regression from https://github.com/civicrm/civicrm-core/pull/26742.
I had this passed in as $data
to AbstractRunAction::rewrite()
:
array (
'id' => 4,
'Participant_Contact_contact_id_01.display_name' => 'Test Test',
'Attendance_Tracking.Time_in' => NULL,
'Attendance_Tracking.Time_out' => NULL,
'source' => 'Online Event Registration: Weekday Drop-In Program',
'event_id' => 95,
'Participant_Contact_contact_id_01.id' => 25,
'role_id' =>
array (
0 => '1',
),
'event_id.event_type_id' => 1,
)
This yields the error:
Error: Cannot use a scalar value as an array
The issue arises because of event_id
and event_id.event_type_id
. event_id.event_type_id
is supposed to be converted to:
[
'event_id' => ['event_type_id' => 1]
]
However, event_id
is already equal to 95
.
I'm going to take a first run at this, though I'm not sure if I know the correct solution.