ZF-11801: formFile ViewHelper renders id /name attribute not correct when in subform
when using a Zend_Form_Element_File - element inside of a fieldset, the fieldset prefix is not added to the name and id of the rendered file input tag.
$preview_image = new Zend_Form_SubForm(); $preview_image->setLegend('Preview Image'); $test_file = new Zend_Form_Element_File('test_file'); $test_file->setLabel('Test Label'); $preview_image->addElement($test_file); $this->addSubForms(array( 'preview_image' => $preview_image ));
The id and name attribute of the file input should be "preview_image-test_file" just like the label's for attribute value. And of course the name should be the FullyQualifiedName "preview_image[test_file]". At least the ViewHelpers in all other Form Elements do behave that way.
If I set the 'ViewHleper' as additional Decorator, the output of the ViewHelper (uses 'formFile' in this case) is right. But since I have to use the 'File' Decorator also ( I don't understand why ), the output of this one is wrong.