ZF-3814: Exception raised when using addValidator with different case for validator class name

Issue Type: Bug Created: 2008-07-31T03:06:40.000+0000 Last Updated: 2008-09-02T10:39:05.000+0000 Status: Resolved Fix version(s): - 1.6.0 (02/Sep/08)

Reporter: Kamil Sarna (ksarna) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form

Related issues: Attachments:


Sample code:

<pre class="highlight">

$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.

<pre class="highlight">
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)


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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.