Skip to content

Commit a2cb37e

Browse files
minor #34610 [DoctrineBridge] Removed legacy checks in DoctrineChoiceLoader (HeahDude)
This PR was merged into the 5.0 branch. Discussion ---------- [DoctrineBridge] Removed legacy checks in DoctrineChoiceLoader | Q | A | ------------- | --- | Branch? | 5.0 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | ~ | License | MIT | Doc PR | ~ <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master. --> Commits ------- 20d2cca [DoctrineBridge] Removed legacy checks in DoctrineChoiceLoader
2 parents 0386b40 + 20d2cca commit a2cb37e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function loadValuesForChoices(array $choices, callable $value = null)
8787
$optimize = $this->idReader && (null === $value || \is_array($value) && $value[0] === $this->idReader);
8888

8989
// Attention: This optimization does not check choices for existence
90-
if ($optimize && !$this->choiceList && $this->idReader->isSingleId()) {
90+
if ($optimize && !$this->choiceList) {
9191
$values = [];
9292

9393
// Maintain order and indices of the given objects
@@ -123,7 +123,7 @@ public function loadChoicesForValues(array $values, callable $value = null)
123123
// a single-field identifier
124124
$optimize = $this->idReader && (null === $value || \is_array($value) && $this->idReader === $value[0]);
125125

126-
if ($optimize && !$this->choiceList && $this->objectLoader && $this->idReader->isSingleId()) {
126+
if ($optimize && !$this->choiceList && $this->objectLoader) {
127127
$unorderedObjects = $this->objectLoader->getEntitiesByIds($this->idReader->getIdField(), $values);
128128
$objectsById = [];
129129
$objects = [];

0 commit comments

Comments
 (0)