clear unchecked choice radio boxes even if clear missing is set to false
This commit is contained in:
parent
13055b6d66
commit
e7b4851ea0
|
@ -141,6 +141,8 @@ class ChoiceType extends AbstractType
|
|||
$knownValues[$child->getName()] = $value;
|
||||
unset($unknownValues[$value]);
|
||||
continue;
|
||||
} else {
|
||||
$knownValues[$child->getName()] = null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1287,6 +1287,20 @@ class ChoiceTypeTest extends BaseTypeTest
|
|||
$this->assertNull($form[4]->getViewData());
|
||||
}
|
||||
|
||||
public function testSubmitSingleExpandedClearMissingFalse()
|
||||
{
|
||||
$form = $this->factory->create(self::TESTED_TYPE, 'foo', [
|
||||
'choices' => [
|
||||
'foo label' => 'foo',
|
||||
'bar label' => 'bar',
|
||||
],
|
||||
'expanded' => true,
|
||||
]);
|
||||
$form->submit('bar', false);
|
||||
|
||||
$this->assertSame('bar', $form->getData());
|
||||
}
|
||||
|
||||
public function testSubmitMultipleExpanded()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, [
|
||||
|
|
Reference in New Issue