-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
orderBy not being respected #11163
Comments
Could you please check whether it is specific for the XML mapping and/or using fetch=EAGER? |
the same problem occurs with annotation mapping (learned the hard way today 😆 ) |
@grossmannmartin are you using |
Yes, Yes I was. |
Tested con 2.18.0, does not work: #[ORM\OneToMany(mappedBy: 'parent', targetEntity: VariableEntity::class, fetch: 'EAGER')]
#[ORM\OrderBy(value: ['name' => 'ASC'])]
private Collection $variables; |
We have hit the same problem of the If I change this to:
all is well again (at least for our simple case). |
Fetch EAGER mode ignores orderBy as of changes introduced with doctrine#8391 Fixes duplicated doctrine#11381
Fetch EAGER mode ignores orderBy as of changes introduced with doctrine#8391 Fixes duplicated doctrine#11381
Fetch EAGER mode ignores orderBy as of changes introduced with doctrine#8391 Fixes duplicated doctrine#11381
Fetch EAGER mode ignores orderBy as of changes introduced with doctrine#8391 Fixes duplicated doctrine#11381
Thankyou @tomasz-ryba @greg0ire |
Bug Report
Summary
I have a relationship between Threads and Messages. One thread can contain many Messages. Using XML mapping there is an orderBy entry stating the collection of messages should be ordered by their created at date. This works correctly on v2.16.3 but open upgrading to 2.17.2 this is no longer respected and the collection of messages is ordered by it's UUID.
Current behavior
orderBy entry not being respected and instead sorting the collection by UUID
How to reproduce
Use QueryBuilder to get a collection of Threads.
Expected behavior
orderBy entry to be respected and order the collection by the stated field.
The text was updated successfully, but these errors were encountered: