ZF-5092: Form element validators added before setName does not take effect


If you set validators like the following, the size validator runs but the extension one does not. This might be because setName updates $_name but remains update _adapter -> _files array. I am not sure whether it occurs with other form elements or not.

$element = new Zend_Form_Element_File('hoge'); $element->setDestination('/tmp') ->addValidator('Size', false, 1024) ->setName('foo') ->addValidator('Extension', false, 'jpg,png,gif') ;


I have a problem like this and maybe it's related... When i have $form->setName("formname") the validation doesn't work... but if i remove the setName it works... i fixed some forms by removing the name but i have a form where i really need the name on it and this is blocking my project... I'am using Zend_Dojo_Form and Zend 1.11.10... thx