doctrine / orm

Doctrine Object Relational Mapper (ORM)
https://www.doctrine-project.org/projects/orm.html
MIT License
9.86k stars 2.5k forks source link

Ignore orderBy in UOW eagerLoadCollections() method #11381

Closed lewbor closed 2 months ago

lewbor commented 3 months ago

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']);

tomasz-ryba commented 3 months ago

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

beberlei commented 2 months ago

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