Issues

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

Description

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.

Comments

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.