Wrote/rerolled the patch for search_api 1.29.0
I wrote the patch before finding this issue, in hindsight in exactly the same way as the already existing patches. Could this patch be merged, so we don't have to keep rerolling it: the patch is a clean solution. I'm using it in production on a Drupal 9.5.7.
- π¦πΉAustria drunken monkey Vienna, Austria
@ sboden: Same as for the old patch, this is missing tests and an upgrade path.
Tests are missing, ok.
For the upgrade path, that might be tricky. But, when you define a field with allowed_values_function, you can't use allowed_values in the Drupal GUI anymore - the options are mutually exclusive. So the patch is actually "new" functionality: without the patch search_api would only take allowed_values into account, after the patch allowed_values_function is also taken into account which people who defined a field as such would want to use. When allowed_values_function is filled in, allowed_values is empty anyway.
Are there people who defined a filter on a field using allowed_values_function but assume users will filter using its key as search criteria (without dropdown), I doubt it. That's e.g. why I ended up on this issue.
- π¦πΉAustria drunken monkey Vienna, Austria
As described in #7, even if this is likely the expected behavior in general, specifically at an update this might break peopleβs views, which should really be avoided, if possible. Especially for a new feature, not a bug fix.