EasyAdminBundle
EasyAdminBundle copied to clipboard
setSearchFields does not work for AssociationField called `Entity`
Describe the bug
I have Entity model in my application, since query builder creates SQL/DQL and uses entity keyword as as one for the root entity, I cannot use e.g. entity.name as setSearchField, it collides.
To Reproduce easycorp/easyadmin-bundle: v4.26.5 Create any model, then create model with name Entity, as association of Any model, then try to setSearchFields(['entity.name']) for configureCrud inside AnyCrudController.
(OPTIONAL) Additional context
[2025-10-29T13:28:26.669340+00:00] request.CRITICAL: Uncaught PHP Exception Doctrine\ORM\Query\QueryException: "[Semantical Error] line 0, col 79 near 'entity WHERE': Error: 'entity' is already defined." at QueryException.php line 28 {"exception":"[object] (Doctrine\\ORM\\Query\\QueryException(code: 0): [Semantical Error] line 0, col 79 near 'entity WHERE': Error: 'entity' is already defined. at /app/vendor/doctrine/orm/src/Query/QueryException.php:28)\n[previous exception] [object] (Doctrine\\ORM\\Query\\QueryException(code: 0): SELECT entity FROM App\\Domain\\Issue\\Model\\Issue entity LEFT JOIN entity.entity entity WHERE LOWER(CONCAT(entity.issueDescription.name, '')) LIKE :query_for_text_1 OR LOWER(CONCAT(entity.name, '')) LIKE :query_for_text_1 at /app/vendor/doctrine/orm/src/Query/QueryException.php:18)"} []