Ignore orderBy in UOW eagerLoadCollections() method #7345

Closed
opened 2026-01-22 15:50:20 +01:00 by admin · 2 comments
Owner

Originally created by @lewbor on GitHub (Mar 19, 2024).

Bug Report

Q A
BC Break no
Version 2.19.1

Summary

When using a collection eager loading (UnitOfWork::eagerLoadCollections method), #[OrderBy] attribute on collection is ignoring now. In line
$found = $this->getEntityPersister($targetEntity)->loadAll([$mappedBy => $entities])
it must be
$found = $this->getEntityPersister($targetEntity)->loadAll([$mappedBy => $entities], $mapping['orderBy']);

Originally created by @lewbor on GitHub (Mar 19, 2024). ### Bug Report | Q | A |------------ | ------ | BC Break | no | Version | 2.19.1 #### Summary When using a collection eager loading (UnitOfWork::eagerLoadCollections method), #[OrderBy] attribute on collection is ignoring now. In line `$found = $this->getEntityPersister($targetEntity)->loadAll([$mappedBy => $entities])` it must be `$found = $this->getEntityPersister($targetEntity)->loadAll([$mappedBy => $entities], $mapping['orderBy']);`
admin closed this issue 2026-01-22 15:50:20 +01:00
Author
Owner

@tomasz-ryba commented on GitHub (Mar 20, 2024):

It's an older problem already discussed here #11163 and seems to be related to changes introduced with #8391

@tomasz-ryba commented on GitHub (Mar 20, 2024): It's an older problem already discussed here #11163 and seems to be related to changes introduced with #8391
Author
Owner

@beberlei commented on GitHub (Apr 27, 2024):

Fixed by https://github.com/doctrine/orm/pull/11422

@beberlei commented on GitHub (Apr 27, 2024): Fixed by https://github.com/doctrine/orm/pull/11422
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7345