Skip to content

Commit f293d47

Browse files
committed
[Form] refactor CheckboxListMapper and RadioListMapper
fixes #14712 and #17789. `ChoiceType` now always use `ChoiceToValueTransformer` or `ChoicesToValuesTransformer` depending on `multiple` option. Hence `CheckboxListMapper` and `RadioListMapper` don’t handle the transformation anymore. Fixes pre selection of choice with model values such as `null`, `false` or empty string.
1 parent a343cd2 commit f293d47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Tests/Form/Type/EntityTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public function testSubmitSingleExpandedNull()
261261
$field->submit(null);
262262

263263
$this->assertNull($field->getData());
264-
$this->assertNull($field->getViewData());
264+
$this->assertSame('', $field->getViewData(), 'View data is always a string');
265265
}
266266

267267
public function testSubmitSingleNonExpandedNull()

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"require-dev": {
2323
"symfony/stopwatch": "~2.2",
2424
"symfony/dependency-injection": "~2.2",
25-
"symfony/form": "~2.7,>=2.7.1",
25+
"symfony/form": "~2.7.12|~2.8.5",
2626
"symfony/http-kernel": "~2.2",
2727
"symfony/property-access": "~2.3",
2828
"symfony/security": "~2.2",

0 commit comments

Comments
 (0)