[BUGFIX] Reset hidden field information in FormViewhelper 86/50486/2
authorNicole Cordes <typo3@cordes.co>
Wed, 2 Nov 2016 23:26:04 +0000 (00:26 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 2 Dec 2016 15:04:02 +0000 (16:04 +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/50486
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php

index f574686..7d3abc3 100644 (file)
@@ -393,6 +393,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');
+        }
     }
 
     /**