Skip to content

Commit

Permalink
[Form][2.3] Fixes empty file-inputs getting treated as extra field.
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkoian authored and fabpot committed Mar 3, 2014
1 parent e4b9ff2 commit 8d99d75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/Form.php
Expand Up @@ -556,7 +556,7 @@ public function submit($submittedData, $clearMissing = true)
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/Tests/CompoundFormTest.php
Expand Up @@ -115,7 +115,7 @@ public function testSubmitDoesNotAddExtraFieldForNullValues()
$child = $factory->create('file', null, array('auto_initialize' => false));

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

$this->assertCount(0, $this->form->getExtraData());
}
Expand Down

0 comments on commit 8d99d75

Please sign in to comment.