ZF-11807: Zend_Form_Element getDecorator showing NOTICES

Description

I added a Custon Decorator to an element and when I outputted the form I got some notices

"Warning: Illegal offset type in isset or empty in /var/www/project/library/Zend/Form/Element.php on line 1932 Notice: Array to string conversion in /var/www/project/library/Zend/Form/Element.php on line 1933 Warning: substr_compare() expects parameter 2 to be string, array given in /var/www/project/library/Zend/Form/Element.php on line 1939"

$element->addDecorator(array('row' => 'HtmlTag'), array('tag' => 'div', 'id' => 'user_content','class' => 'content colunas3', 'openOnly' => true));

Debbuging I solved this problem adding a verification of type on "getDecorator" method available in Zend_Form_Element

" public function getDecorator($name) { if (is_array($name)) { $name = $name[key($name)]; } ... "

Comments

No comments to display