8000 [2.7] [WIP] Fix for #14583 · phansys/symfony@93bb427 · GitHub
[go: up one dir, main page]

Skip to content

Commit 93bb427

Browse files
committed
[2.7] [WIP] Fix for symfony#14583
| Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#14583 | License | MIT | Doc PR | Fixes symfony#14583.
1 parent 7ec5b4f commit 93bb427

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ public function reverseTransform($value)
4343
throw new TransformationFailedException('Expected a scalar.');
4444
}
4545

46+
if (null === $value || '' === $value) {
47+
return;
48+
}
49+
4650
$choices = $this->choiceList->getChoicesForValues(array((string) $value));
4751

4852
if (1 !== count($choices)) {
49-
if (null === $value || '' === $value) {
50-
return;
51-
}
52-
5353
throw new TransformationFailedException(sprintf('The choice "%s" does not exist or is not unique', $value));
5454
}
5555

0 commit comments

Comments
 (0)
0