admin icon indicating copy to clipboard operation
admin copied to clipboard

Various API Filters not showing in the UI

Open zolex opened this issue 7 months ago • 1 comments

API Platform version(s) affected: v4.0.7

Description
Many of the available Filters in api-platform/core seem to not be properly supported by the PWA.

In my example, the following SearchFilter and OrderFilter attributes with nested properties are configured for the Coffee entity:

enter image description here

The backend part works as expected, so I can order and search by the given nested properties on the API itself. Also when I manually edit the respective query params in the HydraAdmin URL, it properly shows the searched and ordered results.

Here using beans.type=/bean_types/{id} enter image description here

And here using beans.type.name={name} enter image description here

The actual problem seems to be in the HydraAdmin so that it does not offer the nested properties in the "Add Filter" section and also it does not show it under "Active Filters".

A similar but a bit different problem happens for the OrderFilter with nested properties: When I manually set it in the query params it works, but when clicking on the roaster-order it sends order=roaster instead of order=roaster.name

enter image description here

Another broken case is the RangeFilter.

enter image description here

It passes the filter properly to the API but does not show it under add filters or active filters.

enter image description here

How to reproduce
use this repository: https://github.com/zolex/cee-jourlly

docker compose up
docker compose exec php bin/console doctrine:database:create --no-interaction
docker compose exec php bin/console doctrine:migrations:migrate --no-interaction
docker compose exec php bin/console hautelook:fixtures:load --no-interaction

zolex avatar Jun 06 '25 11:06 zolex

Reproduced, thanks!

There are evidences in the code suggesting this is supposed to work (or at least did at some point) so I'm marking this as a bug.

https://github.com/api-platform/admin/blob/20271863e30dd0f3887d9b81952be78ae0a6c0ef/src/introspection/schemaAnalyzer.ts#L33-L46

Thanks for the report.

slax57 avatar Jun 13 '25 16:06 slax57