The current implementation of eagerLoad does not allow that multiple objects have the same has_one relation.
If I have a relation like in the yaml file below, the eager query will load all required EagerLoadBars but will only pass the object into the last EagerLoadFoo object, all objects before will trigger an additional query to the database.
Module version(s) affected
5.1.18
Description
The current implementation of eagerLoad does not allow that multiple objects have the same has_one relation.
If I have a relation like in the yaml file below, the eager query will load all required
EagerLoadBar
s but will only pass the object into the lastEagerLoadFoo
object, all objects before will trigger an additional query to the database.Is this wanted?
How to reproduce
Possible Solution
Modify the
DataList::fetchEagerLoadHasOne
to store multiple IDs per Relation.Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)PRs