diff -r 5a6b6e770365 -r 68c69c656a2c web/lib/Zend/Form/Element/File.php --- a/web/lib/Zend/Form/Element/File.php Thu May 07 15:10:09 2015 +0200 +++ b/web/lib/Zend/Form/Element/File.php Thu May 07 15:16:02 2015 +0200 @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,9 +27,9 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: File.php 25225 2013-01-17 15:59:16Z frosch $ + * @version $Id$ */ class Zend_Form_Element_File extends Zend_Form_Element_Xhtml { @@ -79,14 +79,19 @@ return $this; } - $decorators = $this->getDecorators(); - if (empty($decorators)) { - $this->addDecorator('File') - ->addDecorator('Errors') - ->addDecorator('Description', array('tag' => 'p', 'class' => 'description')) - ->addDecorator('HtmlTag', array('tag' => 'dd')) - ->addDecorator('Label', array('tag' => 'dt')); + parent::loadDefaultDecorators(); + + // This element needs the File decorator and not the ViewHelper decorator + if (false !== $this->getDecorator('ViewHelper')) { + $this->removeDecorator('ViewHelper'); } + if (false === $this->getDecorator('File')) { + // Add File decorator to the beginning + $decorators = $this->getDecorators(); + array_unshift($decorators, 'File'); + $this->setDecorators($decorators); + } + return $this; } @@ -168,6 +173,7 @@ * * @param string|Zend_File_Transfer_Adapter_Abstract $adapter * @return Zend_Form_Element_File + * @throws Zend_Form_Element_Exception */ public function setTransferAdapter($adapter) { @@ -341,7 +347,7 @@ /** * Sets a filter for the class, erasing all previous set; proxy to adapter * - * @param string|array $filter Filter to set + * @param array $filters Filters to set * @return Zend_Form_Element_File */ public function setFilters(array $filters) @@ -856,6 +862,7 @@ * * @param Zend_View_Interface $view * @return string + * @throws Zend_Form_Element_Exception */ public function render(Zend_View_Interface $view = null) {