Issue Type: Bug Created: 2012-08-22T22:57:00.000+0000 Last Updated: 2012-10-08T20:14:50.000+0000 Status: Closed Fix version(s): Reporter: Jurian Sluiman (mithras) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend\Validator
Related issues: Attachments:
In an InputFilter instance the "message" option (which will call the Zend\Validator\EmailAddress::setMessage() ) does not get through when an error is made.
The root cause is because the Zend\Validator\AbstractValidator::setMessage() uses $this->abstractOptions['messageTemplates'] and the template keys are not the keys from the EmailAddress validator. Therefore when every template has set its own message, the real messages for the EmailAddress validator aren't set.
Possible test case:
<pre class="highlight"> $this->add(array( 'name' => 'email', 'required' => true, 'validators' => array( array( 'name' => 'EmailAddress', 'options' => array( 'message' => 'This is not a valid email address' ) ) ), ));
For an InputFilter attached to a Form which has an element called "email". If tested with "a@@com" as input, seven errors occur of which none uses the set message.
Posted by Ralph Schindler (ralph) on 2012-10-08T20:14:50.000+0000
This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2538
Have you found an issue?
See the Overview section for more details.