core icon indicating copy to clipboard operation
core copied to clipboard

OrderBy Alias don't recognize doctrine function

Open alexandre-lxi opened this issue 3 years ago • 0 comments

API Platform version(s) affected: 2.6.8

Description
I use a doctrine function in my orderBy but the queyBuilder not recognize it. ->addOrderBy("JSON_GET_FIELD_AS_INTEGER(usuggest.jScores,'{$alpha}')", 'DESC')

I have this error code : The alias "JSON_GET_FIELD_AS_INTEGER(usuggest" does not exist in the QueryBuilder.

How to reproduce
Add a string fucntion in orderBy in extension file.

Possible Solution
Update the QueryChecker.php to recongnize functions.

alexandre-lxi avatar Apr 29 '22 11:04 alexandre-lxi