mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Doctrine places joined element OrderBy clause in another element's juncture condition's subQuery #5880
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Cedoriku on GitHub (Feb 13, 2018).
Hello,
I am having an issue with a multiple junctures query, in which one (a) is based on a subquery condition with an order by clause, and another (b) has an orderBy clause specified in the entity's attribute annotation.
What happens is that Doctrine adds the b orderby clause to the the one in the subquery, where there is no b in scope, instead of putting it in the main query, where it belongs. Basically this results in an SQL error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'u7_.level' in 'order clause'.. seems legit..
Here is my thread on Stackoverflow with the complete explanation:
https://stackoverflow.com/questions/48684549/dql-query-doctrine-places-joined-element-orderby-clause-in-another-elements-jun
Every juncture is attached to the same main entity.
@Cedoriku commented on GitHub (Feb 13, 2018):
OK I reordered the junctures in the query builder and it seems to work.. kind of tricky thought