ZF-6705: Element Class (Form) _loadValidator() uses unset() on an offset and this throw a fatal error

Issue Type: Bug Created: 2009-05-17T14:31:09.000+0000 Last Updated: 2012-11-20T20:53:23.000+0000 Status: Closed Fix version(s): Reporter: ramon himera (ramonhimera) Assignee: None Tags: - Zend_Form

Related issues: Attachments:


Element Class (Form) _loadValidator() uses unset() on an offset and this throw a fatal error when trying to clear $validator['options']['messages'] on line 1969. The error was thrown when i called form->isValid() using a custom validator.

Element.php (_loadValidator): if (isset($validator['options']['messages'])) { $messages = $validator['options']['messages']; unset($validator['options']['messages']); }

In my form class: $name = new Zend_Form_Element_Text('name'); $name->setLabel('Event name:')->setRequired(true); $name->addPrefixPath('BC_Validate', 'BC/Validate', 'validate'); $name->addValidator('EventName', false);

File BC/Validate/EventName.php defines the function isValid($value, $context)

I had to check the type before resetting the variable to empty. The version i am using is 1.6.0 but i noted the line of code is still present in 1.80 but i havent tested on this.


Posted by Rob Allen (rob) on 2012-11-20T20:53:23.000+0000

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.

Have you found an issue?

See the Overview section for more details.


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

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