Index: library/Zend/Form.php =================================================================== --- library/Zend/Form.php (revision 25211) +++ library/Zend/Form.php (working copy) @@ -1027,7 +1027,9 @@ if (is_string($element)) { if (null === $name) { require_once 'Zend/Form/Exception.php'; - throw new Zend_Form_Exception('Elements specified by string must have an accompanying name'); + throw new Zend_Form_Exception( + 'Elements specified by string must have an accompanying name' + ); } $this->_elements[$name] = $this->createElement($element, $name, $options); @@ -1038,6 +1040,12 @@ $prefixPaths = array_merge($prefixPaths, $this->_elementPrefixPaths); } + if (is_array($this->_elementDecorators) + && 0 == count($element->getDecorators()) + ) { + $element->setDecorators($this->_elementDecorators); + } + if (null === $name) { $name = $element->getName(); } @@ -1046,7 +1054,9 @@ $this->_elements[$name]->addPrefixPaths($prefixPaths); } else { require_once 'Zend/Form/Exception.php'; - throw new Zend_Form_Exception('Element must be specified by string or Zend_Form_Element instance'); + throw new Zend_Form_Exception( + 'Element must be specified by string or Zend_Form_Element instance' + ); } $this->_order[$name] = $this->_elements[$name]->getOrder();