Issues

ZF-3852: Zend_Form_Element::addError() is not array-aware

Description

From the list:


Adding an error on an element 'multiCheckbox' does not work :

$droitModel = new Droit();
$tabDroits = $droitModel->getDroitsModule($this->initData->module);
$droits = $this->createElement('multiCheckbox', 'droits');
$droits->setMultiOptions($tabDroits)
       ->setLabel($this->_translateController->_('type_droits'))
       ->setValue($this->initData->droits)
       ->setDecorators($this->_elementDecorators)
       ->setRequired(true);
        
$droits->addError('test');

Error : Notice: Array to string conversion in
/usr/share/php/Zend/Form/Element.php on line 2063.
Zend_Form_Element ligne 2063 : $messages[$key] = str_replace('%value%',
$value, $message);
$value is a array in the case of an element with a multiOptions.

Comments

Resolved in trunk and 1.6 release branch with r10673 and r10674, respectively

Updating for the 1.6.0 release.