mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Calling distinct() on QueryBuilder does not update state correctly #7168
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 @macroparts on GitHub (Jun 22, 2023).
Bug Report
Summary
When calling distinct() on a Query builder after getQuery(), then a subsequent getQuery() would ignore the distinct query part.
Current behavior
See summary
How to reproduce
Expected behavior
The second getQuery() call should return a Query using the distinct keyword.
@greg0ire commented on GitHub (Jun 23, 2023):
Looks like it would be fixed by adding
$this->state = self::STATE_DIRTYinsidedistinct()… are you up to send a PR?@macroparts commented on GitHub (Jun 23, 2023):
@greg0ire hope I was following your contribution guidelines correctly. I will appreciate a review of my PR.
@greg0ire commented on GitHub (Jun 23, 2023):
What version are you using, precisely?
@macroparts commented on GitHub (Jun 23, 2023):
2.14.3 is currently used in my project and I was hoping to get a fix for that version but I can also aim for an upgrade and submit a fix for 2.15.x
@greg0ire commented on GitHub (Jun 23, 2023):
Please do, 2.14.x is no longer maintained.