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;
|
$knownValues[$child->getName()] = $value;
|
||||||
unset($unknownValues[$value]);
|
unset($unknownValues[$value]);
|
||||||
continue;
|
continue;
|
||||||
|
} else {
|
||||||
|
$knownValues[$child->getName()] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1287,6 +1287,20 @@ class ChoiceTypeTest extends BaseTypeTest
|
||||||
$this->assertNull($form[4]->getViewData());
|
$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()
|
public function testSubmitMultipleExpanded()
|
||||||
{
|
{
|
||||||
$form = $this->factory->create(static::TESTED_TYPE, null, [
|
$form = $this->factory->create(static::TESTED_TYPE, null, [
|
||||||
|
|
Reference in New Issue