Search Kit: Commas in event types break IN operator
When you have an event type with a comma in it, you can't search for it using the WHERE
clause using the IN
operator.
Steps to Replicate
- Create a new event type with a comma in the label (which will propagate to the name).
- Create an event with the new event type.
- Create a SK search with a
WHERE
event typeis one of
the new event type.
Expected Result
The new event will appear.
Actual Result
Event doesn't appear.
See screenshots comparing =
and is one of
.
Comments
SK assumes that name
fields can't have commas, so it can explode the string on a comma delimiter. This is the API query for the screenshot above (below).
If event types were their own table, I'd suggest making the name
field be snake-cased. However, this goes against a long-standing (and probably unwise) design decision around civicrm_option_value
names, which can be used to match on import with external systems. So this may have to get fixed in SK.
{
"version": 4,
"select": [
"id",
"title",
"event_type_id:label"
],
"orderBy": {},
"where": [
[
"event_type_id:name",
"IN",
[
"Development",
"Administration"
]
]
],
"groupBy": [],
"join": [],
"having": []
}