ZF-7235: FormErrors not taking Zend_Form setIsArray into account


FormErrors function "_recurseForm" does not check for the setting "isArray" on the supplied zend form.

When using subforms the first if statement (ln. 372) is triggered. This behaviour is also wanted when using your main form as isArray. Because this makes the array multidimensional.

This is leading to a non functional FormErrors decorator. Because it will never get the errors into the foreach loop on ln 383.

I momentarily fixed it by addind "|| $form->isArray()" to the if statement on ln 372. Don't know if that is the correct fix but i thought i should share


The code below shows that the FormErrors decorator produces no output if the forms isArray flag is true.

require_once 'Zend/Debug.php';
require_once 'Zend/Form.php';
require_once 'Zend/Form/Decorator/FormErrors.php';
require_once 'Zend/Form/Element/Select.php';
require_once 'Zend/View.php';

$form = new Zend_Form(
            new Zend_Form_Decorator_FormErrors(),

$form->setView(new Zend_View());

$form->addElement(new Zend_Form_Element_Select(array('name'=>'test', 'multiOptions'=>array(0,1))));



$formErrorsDecorator = $form->getDecorator('FormErrors');



Fixed in trunk r22270 and merged into 1.10 release branch