8000 bug #50937 [Form] fetch all known ChoiceType values at once (xabbuh) · symfony/symfony@fbd3988 · GitHub
[go: up one dir, main page]

Skip to content

Commit fbd3988

Browse files
committed
bug #50937 [Form] fetch all known ChoiceType values at once (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [Form] fetch all known ChoiceType values at once | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #50898 | License | MIT | Doc PR | Commits ------- 5e0f832 fetch all known ChoiceType values at once
2 parents f57faf3 + 5e0f832 commit fbd3988

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
165165
}
166166
}
167167
} else {
168-
foreach ($data as $value) {
169-
if ($choiceList->getChoicesForValues([$value])) {
170-
$knownValues[] = $value;
171-
unset($unknownValues[$value]);
172-
}
168+
foreach ($choiceList->getChoicesForValues($data) as $key => $choice) {
169+
$knownValues[] = $data[$key];
170+
unset($unknownValues[$data[$key]]);
173171
}
174172
}
175173

0 commit comments

Comments
 (0)
0