Skip to content

Commit 8d99d75

Browse files
jenkoianfabpot
authored andcommitted
[Form][2.3] Fixes empty file-inputs getting treated as extra field.
1 parent e4b9ff2 commit 8d99d75

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Form/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ public function submit($submittedData, $clearMissing = true)
556556
}
557557

558558
foreach ($this->children as $name => $child) {
559-
if (isset($submittedData[$name]) || $clearMissing) {
559+
if (array_key_exists($name, $submittedData) || $clearMissing) {
560560
$child->submit(isset($submittedData[$name]) ? $submittedData[$name] : null, $clearMissing);
561561
unset($submittedData[$name]);
562562

src/Symfony/Component/Form/Tests/CompoundFormTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function testSubmitDoesNotAddExtraFieldForNullValues()
115115
$child = $factory->create('file', null, array('auto_initialize' => false));
116116

117117
$this->form->add($child);
118-
$this->form->submit(array('file' => null));
118+
$this->form->submit(array('file' => null), false);
119119

120120
$this->assertCount(0, $this->form->getExtraData());
121121
}

0 commit comments

Comments
 (0)