Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] ORMQueryBuilderLoader::getEntitiesByIds executing query despite that Entity is already loaded #57780

Copy link
Copy link
Open
@oleg-andreyev

Description

@oleg-andreyev
Issue body actions

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)

  1. I've re-loaded all required entities using IN (...) so they are in UoW
  2. Without Autocomplete is just a wrapper over EntityType
  3. No custom query_builder
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.