diff --git a/src/Symfony/Component/DomCrawler/Form.php b/src/Symfony/Component/DomCrawler/Form.php index 87ab31485f39..375ee531c4a0 100644 --- a/src/Symfony/Component/DomCrawler/Form.php +++ b/src/Symfony/Component/DomCrawler/Form.php @@ -89,10 +89,6 @@ public function getValues() { $values = []; foreach ($this->fields->all() as $name => $field) { - if ($field->isDisabled()) { - continue; - } - if (!$field instanceof Field\FileFormField && $field->hasValue()) { $values[$name] = $field->getValue(); } @@ -115,10 +111,6 @@ public function getFiles() $files = []; foreach ($this->fields->all() as $name => $field) { - if ($field->isDisabled()) { - continue; - } - if ($field instanceof Field\FileFormField) { $files[$name] = $field->getValue(); } @@ -463,7 +455,7 @@ private function initialize() private function addField(\DOMElement $node) { - if (!$node->hasAttribute('name') || !$node->getAttribute('name')) { + if (!$node->hasAttribute('name') || !$node->getAttribute('name') || $node->hasAttribute('disabled')) { return; } diff --git a/src/Symfony/Component/DomCrawler/Tests/FormTest.php b/src/Symfony/Component/DomCrawler/Tests/FormTest.php index 45d964b08c8d..1867f30a651a 100644 --- a/src/Symfony/Component/DomCrawler/Tests/FormTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/FormTest.php @@ -158,12 +158,12 @@ public function testConstructorHandlesFormValues() public function testMultiValuedFields() { $form = $this->createForm('
- - - - - - + + + + + +
'); @@ -226,10 +226,10 @@ public function provideInitializeValues() [], ], [ - 'takes into account disabled input fields', + 'skips disabled input fields', ' ', - ['foo' => ['InputFormField', 'foo']], + [], ], [ 'appends the submitted button value',