-
Notifications
You must be signed in to change notification settings - Fork 819
Open
Description
Module version(s) affected
5.4, 6.0, 6.1
Description
I think EagerLoadedList should be kind of dropin setting.
But currenly these calls behave different:
$item = Foo::get()->first()?->Relation()->find('Column', 'Value');
$item = Foo::get()->eagerLoad('Relation')->first()?->Relation()->find('Column', 'Value');The later will throw an error Can't filter by column 'Column' when the Relation is empty.
Because the normaliseFilterArgs calls canFilterBy which will fail if the underlying list is empty.
https://github.com/silverstripe/silverstripe-framework/blob/6/src/ORM/EagerLoadedList.php#L619
The implementation in ArrayList does not throw an error either.
How to reproduce
See above.
Possible Solution
Additional Context
No response
Validations
- Check that there isn't already an issue that reports the same bug
- Double check that your reproduction steps work in a fresh installation of
silverstripe/installer(with any code examples you've provided)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels