Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Not an Issue
-
Affects Version/s: 1.9.6
-
Fix Version/s: None
-
Component/s: Zend_Form
-
Labels:None
Description
We have just updated to 1.9.6 to find that our file upload forms no longer work.
This is due to a bug that was introduced when ZF-7404 was fixed.
This causes the render() method of Zend_Form_Element_File to be called from renderViewHelper() and renderErrors(). Unfortunately, Zend_Form_Element_File::render() throws an exception, as there are no file decorators.
We have worked around the problem locally by returning early from Zend_Form_Element_File::render() if $this->_isPartialRendering is true, but this doesn't seem ideal. Instead of _isPartialRendering, I would recommend that Zend_Form_Element introduces partialRender(), with an empty implementation by default. Zend_Form_Element_Hash could then implement partialRender to fix ZF-7404.
Issue Links
| This issue is related to: | ||||
| ZF-7404 | Zend_Form_Element_Hash does not set a value when renderViewHelper() is called |
|
|
|
The introduction of _isPartialRendering causes Zend_Form_Element_File::render() to be called from Zend_Form_Element_File::renderViewHelper(), which raises an exception when the form element has no decorators. This breaks the file upload form on our site.
A better solution would be to implement Zend_Form_Element::partialRender(), with an empty default implementation, and for Zend_Form_Element_Hash to implement this to fix
ZF-7404.ZF-7404.