ZF-10519: Zend_Form_Decorator_File decorator is using static view helper

Issue Type: Bug Created: 2010-10-05T08:15:29.000+0000 Last Updated: 2012-11-03T14:20:47.000+0000 Status: Resolved Fix version(s): - 1.12.1 (18/Dec/12)

Reporter: Ing. Alexander Poschenreithner (klex) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Form

  • FixForZF1.12

Related issues: Attachments: - ZF-10519.patch


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);


Posted by Ing. Alexander Poschenreithner (klex) on 2010-10-06T00:34:49.000+0000

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

Posted by Adam Lundrigan (adamlundrigan) on 2010-12-18T13:45:07.000+0000

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

Posted by Rob Allen (rob) on 2012-11-03T14:20:47.000+0000

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

Have you found an issue?

See the Overview section for more details.


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

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