ZF-11476: Zend_Form::getMessages for a sub form returns an array, causing Zend_Form_Decorator_Errors to think it has errors

Description

Zend_Form::getMessages for a sub form returns an array, causing Zend_Form_Decorator_Errors to think it has errors. If you create a sub form and add the error decorator to it, the getMessages() function return array('subformname' => ) which Zend_Form_Decorator_Errors interprets as an error

Comments

This is a little hack that works for me

class MySubForm Date extends Zend_Form_Subform { ... public function getMessages($name = null, $suppressArrayNotation = false) { $messages = parent::getMessages($name, $suppressArrayNotation); return !isset($messages[$this->getName()]) ? $messages : null; } ... }

@Emilio Thanks for your proposal, but your code does not work: Test {{Zend_Form_FormTest::testGetMessagesWithElementsBelongTo()}} failed! (Test class)

Fixed on trunk (25252) and release-1.12 (25253)