From 20d2cca7f08675250f3a606054872f37ec03f82b Mon Sep 17 00:00:00 2001 From: Jules Pietri Date: Mon, 25 Nov 2019 19:52:13 +0100 Subject: [PATCH] [DoctrineBridge] Removed legacy checks in DoctrineChoiceLoader --- .../Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php index 87c1f8263f..4e06569b4d 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php @@ -87,7 +87,7 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface $optimize = $this->idReader && (null === $value || \is_array($value) && $value[0] === $this->idReader); // Attention: This optimization does not check choices for existence - if ($optimize && !$this->choiceList && $this->idReader->isSingleId()) { + if ($optimize && !$this->choiceList) { $values = []; // Maintain order and indices of the given objects @@ -123,7 +123,7 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface // a single-field identifier $optimize = $this->idReader && (null === $value || \is_array($value) && $this->idReader === $value[0]); - if ($optimize && !$this->choiceList && $this->objectLoader && $this->idReader->isSingleId()) { + if ($optimize && !$this->choiceList && $this->objectLoader) { $unorderedObjects = $this->objectLoader->getEntitiesByIds($this->idReader->getIdField(), $values); $objectsById = []; $objects = [];