From 6bb355e2fd974f41db417f3c50428514050c7110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adria=CC=80=20Lo=CC=81pez=20Lozano?= Date: Wed, 22 Jan 2014 16:19:57 +0100 Subject: [PATCH] [Form] Added check for parent disabled status in Button form elements The Button form element did not check for the parent disabled configuration status, making them behave differently to all other form widgets. --- src/Symfony/Component/Form/Button.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Button.php b/src/Symfony/Component/Form/Button.php index f12d11afe4..2d7ccd1569 100644 --- a/src/Symfony/Component/Form/Button.php +++ b/src/Symfony/Component/Form/Button.php @@ -321,7 +321,11 @@ class Button implements \IteratorAggregate, FormInterface */ public function isDisabled() { - return $this->config->getDisabled(); + if (null === $this->parent || !$this->parent->isDisabled()) { + return $this->config->getDisabled(); + } + + return true; } /**