[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.
This commit is contained in:
Adrià López Lozano 2014-01-22 16:19:57 +01:00 committed by Bernhard Schussek
parent c778b030a9
commit 6bb355e2fd

View File

@ -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;
}
/**