[BUGFIX] Reset hidden field information in FormViewhelper 56/50856/2
authorNicole Cordes <typo3@cordes.co>
Wed, 2 Nov 2016 23:26:04 +0000 (00:26 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Wed, 7 Dec 2016 12:39:45 +0000 (13:39 +0100)
If a checkbox or a multiple selectbox is rendered, a hidden field is
automatically inserted before to send an empty default value. Field
information are stored within an own viewHelperVariableContainer
variable. After a form is rendered, this information has to be reset to
be able to render another form with same field names. This patch adds
the missing reset of the hidden field information.

Resolves: #78551
Releases: master, 7.6, 6.2
Change-Id: I3cde5618d07cae39b7841875504471cb2341dc17
Reviewed-on: https://review.typo3.org/50856
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>

index 7a562dc..335b87c 100644 (file)
@@ -418,6 +418,9 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
     protected function removeFormFieldNamesFromViewHelperVariableContainer()
         $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formFieldNames');
+        if ($this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields')) {
+            $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'renderedHiddenFields');
+        }