Open
Description
Symfony version(s) affected
6.4.x
Description
I have a page with form where I have collection of items and each time has AutoComplete Field (https://symfony.com/bundles/ux-autocomplete/current/index.html)
- I've re-loaded all required entities using IN (...) so they are in UoW
- Without Autocomplete is just a wrapper over EntityType
- No custom
query_builder
- But as soon as
ORMQueryBuilderLoader::getEntitiesByIds
it does not even try to check current UoW and forces execute query (ignoring UoW cache)
How to reproduce
Possible Solution
Since we have access to UoW, try to check memory before executing QB.
\Doctrine\ORM\UnitOfWork::tryGetById
will return entity or null, if entity returned, we can reduce $values and execute on "rest"
Additional Context
No response