EasyAdminBundle
EasyAdminBundle copied to clipboard
EXTRA_LAZY causing number of queries to triple.
Describe the bug NumberField on OneToMany (EXTRA_LAZY) triples number of queries. This is because method that is used to display field is called 3x.
On "virtual" field.
It's called from
- \EasyCorp\Bundle\EasyAdminBundle\Field\Configurator\CommonPreConfigurator::buildValueOption (isReadable)
- \EasyCorp\Bundle\EasyAdminBundle\Field\Configurator\CommonPreConfigurator::buildValueOption (getValue)
- \EasyCorp\Bundle\EasyAdminBundle\Field\Configurator\CommonPreConfigurator::buildTemplatePathOption (isReadable)
To Reproduce Version: v4.0.10 Entity, with OneToMany, EXTRA_LAZY
(OPTIONAL) Additional context
With EXTRA_LAZY

Without EXTRA_LAZY

Interesting, following
This might be a Doctrine issue? The EXTRA_LAZY means "don't fetch this unless needed" ... but that should only be true for the first time that you try to fetch that data. After that first time, the following two times that value should already be fetched, right?
@javiereguiluz the thing is that EasyAdmin is mapped to a "virtual field" which does some calculation inside (Collection::count) and PersistedCollection with EXTRA_LAZY always executes count query.
I have the same issue,
did you find any workaround or fix?