Issue Type: Bug Created: 2008-08-10T05:27:13.000+0000 Last Updated: 2010-05-04T00:29:38.000+0000 Status: Resolved Fix version(s): Reporter: Jaka Jancar (jaka) Assignee: Christian Albrecht (alab) Tags: - Zend_Form
Related issues: - ZF-9467
If you create an element that represents an array and configure a validator, then isValid() will run the validators on each of the values.
Problem 1: array_merge() is used to concatenate messages and errors If two values have the same error (but a different message), then entries in $messages will be overwritten, since the key (error) is the same.
Problem 2: Information about which of the values caused which message/error is lost, so it's impossible to render the error message next to the individual values.
Suggestion: Keep errors and messages in a separate array for each of the values, e.g.: array(  => array( [errors] => same as now, [messages] => same as now, ),  => array( [errors] => same as now, [messages] => same as now, ), )
Then to maintain backwards compatibility and simplicity merge them on the call to getMessages()/getErrors(). Additionaly add methods like getMessagesForValue($index)/getErrorsForValue($index).
Posted by Christian Albrecht (alab) on 2010-05-04T00:29:36.000+0000
Fixed in trunk r22072 and 1.10 release branch. ZF-9788
Have you found an issue?
See the Overview section for more details.