ZF-10519: Zend_Form_Decorator_File decorator is using static view helper


Zend_Form_Decorator_File, Line 126 and 129

The view helper "$view->formFile()" is typed and not used dynamic from the elements helper ($element->helper). So it's not possible to override / extend the formFile view helper.

(Using 1.11.0dev, source from…)

{{+Line 126:+ $markup[] = $view->formFile($name, $htmlAttribs);}}

{{+Line 129:+ $markup[] = $view->formFile($name, $attribs);}}


I made a patch but didn't find a way to upload it here.

Index: library/Zend/Form/Decorator/File.php

library/Zend/Form/Decorator/File.php (revision 23012)

{{+ Line 120: $helper = $element->helper;}}

{{- Line 126: $markup[] = $view->formFile($name, $htmlAttribs);}} {{+ Line 126: $markup[] = $view->$helper($name, $htmlAttribs);}}

{{- Line 129: $markup[] = $view->formFile($name, $attribs);}} {{+ Line 129: $markup[] = $view->$helper($name, $attribs);}}

============================================ END

Best regards, Alex

Thank you for your suggestion. I've added a patch containing your suggested fix and a test case for it.

Patch applied to trunk (25066) and release-1.12 (25067)