DDC-3436: [GH-1212] [DDC-3108] Fix regression where join aliases were no longer accessible in Criteria expressions #4239

Closed
opened 2026-01-22 14:37:54 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Dec 6, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of kieljohn:

Url: https://github.com/doctrine/doctrine2/pull/1212

Message:

The solution to issue DDC-2764 was to blanket prefix all the fields with the root alias. The result was then impossible to use fields from multiple FROM tables or a JOIN.

This patch injects all available aliases into the comparison, if a field uses one of the aliases it will pass without modification. If it is an unknown alias it will prefix the first rootAlias listed using the same functionality as the deprecated getRootAlias() function.

Also improves the ORDER BY on Criteria expressions, again introduced by [DDC-2764] using the above functionality, this was out of scope of bug [DDC-3108].

Added unit tests to test new functionality.

Originally created by @doctrinebot on GitHub (Dec 6, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of kieljohn: Url: https://github.com/doctrine/doctrine2/pull/1212 Message: The solution to issue [DDC-2764](http://www.doctrine-project.org/jira/browse/DDC-2764) was to blanket prefix all the fields with the root alias. The result was then impossible to use fields from multiple FROM tables or a JOIN. This patch injects all available aliases into the comparison, if a field uses one of the aliases it will pass without modification. If it is an unknown alias it will prefix the first rootAlias listed using the same functionality as the deprecated getRootAlias() function. Also improves the ORDER BY on Criteria expressions, again introduced by [[DDC-2764](http://www.doctrine-project.org/jira/browse/DDC-2764)] using the above functionality, this was out of scope of bug [[DDC-3108](http://www.doctrine-project.org/jira/browse/DDC-3108)]. Added unit tests to test new functionality.
admin added the Bug label 2026-01-22 14:37:54 +01:00
admin closed this issue 2026-01-22 14:37:54 +01:00
Author
Owner
@doctrinebot commented on GitHub (Dec 6, 2014): - relates to [DDC-2764: An orderBy on Criteria leads to DQL semantical error](http://www.doctrine-project.org/jira/browse/DDC-2764) - relates to [DDC-3108: Criteria cannot reference a joined tables' fields when used with an ORM QueryBuilder](http://www.doctrine-project.org/jira/browse/DDC-3108)
Author
Owner

@doctrinebot commented on GitHub (Dec 8, 2014):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1212] was assigned:
https://github.com/doctrine/doctrine2/pull/1212

@doctrinebot commented on GitHub (Dec 8, 2014): Comment created by @doctrinebot: A related Github Pull-Request [GH-1212] was assigned: https://github.com/doctrine/doctrine2/pull/1212
Author
Owner

@doctrinebot commented on GitHub (Jan 17, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1212] was closed:
https://github.com/doctrine/doctrine2/pull/1212

@doctrinebot commented on GitHub (Jan 17, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1212] was closed: https://github.com/doctrine/doctrine2/pull/1212
Author
Owner

@doctrinebot commented on GitHub (Jan 17, 2015):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jan 17, 2015): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4239