Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Not an Issue
-
Affects Version/s: 1.9.1
-
Fix Version/s: 1.9.2
-
Component/s: Zend_Validate
-
Labels:None
Description
Hello all,
I just finished pulling my hair out trying to figure out why my following code failed to set custom error messages.
$email = new Zend_Form_Element_Text('email');
$email->setRequired(true)
->setDecorators(array('ViewHelper',array('JQueryErrors', array('placement' => 'prepend'))))
->setFilters(array('StringTrim', 'StringToLower'))
->addValidator('EmailAddress',false,array('messages' => array(
'emailAddressInvalid' => 'Please provide a valid email address.',
'emailAddressInvalidHostname' => 'Please provide a valid email address.'
)));
I searched through Zend_Validate_Abstract and some individual classes to see if any changes were made and couldn't find any (not the best way I know
).
I figured something must have been fixed for the 1.9.1 release that broke this feature. To be sure, I rolled back to version 1.8.2 and the above code
does work.
My development environment is as follows:
Windows XP Pro SP2
Apache 2.2
PHP 5.2.5
"Does not work" is not enough information.
What is your input, and which errorkeys and messages are returned ?