ZF-2432: Zend_Validate validators do not all set messages
Description
A number of Zend_Validate concrete validators do not currently set the $_messages array on a failed isValid() call, which means that if you call getMessages() after a failed validation, it may return an empty result. This is problematic when using a validator chain (such as Zend_Validate, or the new Zend_Form component), as the results of getMessages() becomes unpredictable.
Validators known to be missing this functionality include: * Digits * Alnum
Additionally, it would be useful to have the returned array use the error code for the key, such that getMessages() would return array( CODE => ).
Comments
Posted by Darby Felton (darby) on 2008-01-14T16:19:09.000+0000
Would you please provide some test data from which I can reproduce the behavior of {{getMessages()}} returning an empty array for each of the above listed classes? Thanks! :)
Posted by Darby Felton (darby) on 2008-01-15T11:23:18.000+0000
I haven't been able to reproduce the described problem with {{getMessages()}} not returning validation failure messages for either listed class, but I have added unit tests to cover the case for some basic input.
I am making the change that {{getMessages()}} returns an array such that:
This allows us to deprecate the superfluous {{getErrors()}} method from the validation interface.
Posted by Darby Felton (darby) on 2008-01-15T16:42:54.000+0000
Resolving as cannot reproduce, having committed SVN r7450.