EasyCorp / EasyAdminBundle

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.
MIT License
3.99k stars 1.01k forks source link

Fixed invalid DQL #6242

Closed alshenetsky closed 1 month ago

alshenetsky commented 1 month ago

Fixes https://github.com/EasyCorp/EasyAdminBundle/issues/6223

When searching text having only integer fields, an invalid DQL like SELECT entity FROM App\Entity\Product entity WHERE is generated because there are no any $queryTermConditions. This PR should fix the issue.

javiereguiluz commented 1 month ago

Thanks for fixing this bug Alexey.

janklan commented 1 month ago

This change broke PostgreSQL search function. I'm getting the following error:

An exception occurred while executing a query: SQLSTATE[42883]: Undefined function: 7 ERROR: function lower(integer) does not exist
LINE 1: ...yee_code) ILIKE $7 OR LOWER(e0_.role) ILIKE $8 OR LOWER(e0_....
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

@javiereguiluz, considering it's a fresh change, would it make sense to reverse it before everyone installs it? It will break every search query where PostgreSQL and integers are involved.

alshenetsky commented 1 month ago

Sorry, my bad :( I've prepared another PR to remedy this situation: https://github.com/EasyCorp/EasyAdminBundle/pull/6262 UPD: It actually makes sense to revert this change and merge https://github.com/EasyCorp/EasyAdminBundle/pull/6227 instead