Hi Jurian,
> $this->add(array(
> 'name' => 'email',
> 'required' => true,
> 'validators' => array(
> array(
> 'name' => 'EmailAddress',
> 'options' => array(
> 'useDomainCheck' => false,
> 'message' => 'The supplied email address is not a valid
> address'
> )
> )
> ),
> ));
When I add this I get the following error:
Fatal error: Call to a member function setMessage() on a non-object in
/home/devhost/zf2domain/vendor/zendframework/zendframework/library/Zend/Validator/EmailAddress.php
on line 125
That error makes sense, since $this->options['hostnameValidator'] can be
null. A check should be added there.
> This also brings me to another "bug" in the email validation chain: if I
> enter a@@com in this email field, I get three times the message "The
> supplied email address is not a valid address". I guess when you set the
> same message to all types of errors, you only want to see one message when
> multiple errors occur.
>
> For the real experts you might display all the seven (!) messages Ralph
> shows in above post, but when all messages are set equally, you probably
> want to display them only once.
Yes, that is a problem. Should I create an issue for this?
Regards,
Ralf