ZF-3814: Exception raised when using addValidator with different case for validator class name
Description
Sample code:
$field = new Zend_Form_Element_Text('text');
$field->addValidator('stringLength', false, array(1,2));
$field->addValidator('StringLength', false, array(1,2));
Exception is raised when validating element.
Exception caught: Validator instance already exists for validator "Array"
Stack trace
#0 /home/oinopion/workspace/worky-bzr/libraries/Zend/Form/Element.php(1173): Zend_Form_Element->_loadValidator(Array)
#1 /home/oinopion/workspace/worky-bzr/libraries/Zend/Form/Element.php(1257): Zend_Form_Element->getValidators()
#2 /home/oinopion/workspace/worky-bzr/libraries/Zend/Form.php(1784): Zend_Form_Element->isValid('dfdsfsdfsdf', Array)
#3 /home/oinopion/workspace/worky-bzr/application/default/controllers/ProfileController.php(211): Zend_Form->isValid(Array)
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2008-07-31T06:06:24.000+0000
Exception string fixed in trunk and 1.6 release branch. Please note: you cannot add duplicate validators or filters, so the exception is correct behavior; the message simply contained an erroneous artifact.
Posted by Wil Sinclair (wil) on 2008-09-02T10:39:05.000+0000
Updating for the 1.6.0 release.