Details
Description
When you have a Zend_Form_Element_Hash element in your form, and you try to render the element not via the regular render() method, but via renderViewHelper(), then the element is rendered without the token set in the value.
The regular render() method is normally inherrited from Zend_Form_Element, but it is redefined so that the method initCsrfToken() is called to initialize the token in the session, before the rendering takes place.
Perhaps the renderViewHelper() method should be explicitly defined in Zend_Form_Element_Hash, so initCsrfToken() can also be invoked before rendering the ViewHelper.
Attachments
Issue Links
| This issue is related to: | ||||
| ZF-8419 | _isPartialRendering in Zend_Form_Element can break Zend_Form_Element_File::render() |
|
|
|
I encountered this one for the second time. Would it be possible to have some kind of initialisation / preparation method that is called before the element is rendered?
As Tom points out, the initCsrfToken() method is only called from within the render() method.