[BUGFIX] EXT:form - exclude hidden fields within summary pages and mails 83/53383/8
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Mon, 3 Jul 2017 10:23:09 +0000 (12:23 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Fri, 8 Sep 2017 05:38:36 +0000 (07:38 +0200)
Add a "renderingOptions" property called "_isHiddenFormElement" to
prevent form elements from being shown within summary pages and emails.

Resolves: #81770
Releases: master, 8.7
Change-Id: Iea3232879fc2be2cae00e5ed5cea565e68e192f3
Reviewed-on: https://review.typo3.org/53383
Reviewed-by: Daniel Lorenz <daniel.lorenz@extco.de>
Tested-by: Daniel Lorenz <daniel.lorenz@extco.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Tested-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
typo3/sysext/form/Configuration/Yaml/BaseSetup.yaml
typo3/sysext/form/Documentation/Config/configuration/Index.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Hidden.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Honeypot.rst
typo3/sysext/form/Documentation/Config/prototypes/formElementsDefinition/formElementTypes/Hidden/renderingOptions/_isHiddenFormElement.rst [new file with mode: 0644]
typo3/sysext/form/Documentation/Config/prototypes/formElementsDefinition/formElementTypes/Honeypot/renderingOptions/_isHiddenFormElement.rst [new file with mode: 0644]

index 29725a8..518c341 100644 (file)
@@ -84,10 +84,13 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
 
             if (
                 !$element instanceof FormElementInterface
-                || $element->getType() === 'Honeypot'
                 || (
                     isset($renderingOptions['_isCompositeFormElement'])
-                    && $renderingOptions['_isCompositeFormElement'] = true
+                    && $renderingOptions['_isCompositeFormElement'] === true
+                )
+                || (
+                    isset($renderingOptions['_isHiddenFormElement'])
+                    && $renderingOptions['_isHiddenFormElement'] === true
                 )
             ) {
                 continue;
index afebdb6..dac7932 100644 (file)
@@ -149,10 +149,14 @@ TYPO3:
               properties:
                 renderAsHiddenField: false
                 styleAttribute: 'position:absolute; margin:0 0 0 -999em;'
+              renderingOptions:
+                _isHiddenFormElement: true
 
             Hidden:
               __inheritances:
                 10: 'TYPO3.CMS.Form.mixins.formElementMixins.FormElementMixin'
+              renderingOptions:
+                _isHiddenFormElement: true
 
             ### FORM ELEMENTS: HTML5 ###
             Email:
index 7d020d9..a95f026 100644 (file)
@@ -1784,6 +1784,8 @@ Full default configuration
               elementErrorClassAttribute: error
               renderAsHiddenField: false
               styleAttribute: 'position:absolute; margin:0 0 0 -999em;'
+            renderingOptions:
+              _isHiddenFormElement: true
           Hidden:
             formEditor:
               editors:
@@ -1836,6 +1838,8 @@ Full default configuration
               containerClassAttribute: input
               elementClassAttribute: ''
               elementErrorClassAttribute: error
+            renderingOptions:
+              _isHiddenFormElement: true
           Email:
             formEditor:
               editors:
index 98b775c..ef81c92 100644 (file)
@@ -16,6 +16,9 @@ Properties
 .. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.hidden.implementationclassname:
 .. include:: Hidden/implementationClassName.rst
 
+.. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.hidden.renderingoptions._isHiddenFormElement:
+.. include:: Hidden/renderingOptions/_isHiddenFormElement.rst
+
 .. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.hidden.properties.containerclassattribute:
 .. include:: Hidden/properties/containerClassAttribute.rst
 
index e0a691e..58534a9 100644 (file)
@@ -15,6 +15,9 @@ Properties
 .. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.honeypot.implementationclassname:
 .. include:: Honeypot/implementationClassName.rst
 
+.. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.honeypot.renderingoptions._isHiddenFormElement:
+.. include:: Honeypot/renderingOptions/_isHiddenFormElement.rst
+
 .. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.honeypot.properties.containerclassattribute:
 .. include:: Honeypot/properties/containerClassAttribute.rst
 
diff --git a/typo3/sysext/form/Documentation/Config/prototypes/formElementsDefinition/formElementTypes/Hidden/renderingOptions/_isHiddenFormElement.rst b/typo3/sysext/form/Documentation/Config/prototypes/formElementsDefinition/formElementTypes/Hidden/renderingOptions/_isHiddenFormElement.rst
new file mode 100644 (file)
index 0000000..1ab6b18
--- /dev/null
@@ -0,0 +1,32 @@
+renderingOptions._isHiddenFormElement
+-------------------------------------
+
+:aspect:`Option path`
+      TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.formElementsDefinition.Hidden.renderingOptions._isHiddenFormElement
+
+:aspect:`Data type`
+      bool
+
+:aspect:`Needed by`
+      Frontend
+
+:aspect:`Overwritable within form definition`
+      Yes
+
+:aspect:`form editor can write this property into the form definition (for prototype 'standard')`
+      No
+
+:aspect:`Mandatory`
+      No
+
+:aspect:`Default value (for prototype 'standard')`
+      .. code-block:: yaml
+         :linenos:
+         :emphasize-lines: 3
+
+         Hidden:
+           renderingOptions:
+             _isHiddenFormElement: true
+
+:aspect:`Description`
+      Internal control setting to define that the form element is not visible within the summary page and emails.
\ No newline at end of file
diff --git a/typo3/sysext/form/Documentation/Config/prototypes/formElementsDefinition/formElementTypes/Honeypot/renderingOptions/_isHiddenFormElement.rst b/typo3/sysext/form/Documentation/Config/prototypes/formElementsDefinition/formElementTypes/Honeypot/renderingOptions/_isHiddenFormElement.rst
new file mode 100644 (file)
index 0000000..0c7cd5b
--- /dev/null
@@ -0,0 +1,32 @@
+renderingOptions._isHiddenFormElement
+-------------------------------------
+
+:aspect:`Option path`
+      TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.formElementsDefinition.Honeypot.renderingOptions._isHiddenFormElement
+
+:aspect:`Data type`
+      bool
+
+:aspect:`Needed by`
+      Frontend
+
+:aspect:`Overwritable within form definition`
+      Yes
+
+:aspect:`form editor can write this property into the form definition (for prototype 'standard')`
+      No
+
+:aspect:`Mandatory`
+      No
+
+:aspect:`Default value (for prototype 'standard')`
+      .. code-block:: yaml
+         :linenos:
+         :emphasize-lines: 3
+
+         Honeypot:
+           renderingOptions:
+             _isHiddenFormElement: true
+
+:aspect:`Description`
+      Internal control setting to define that the form element is not visible within the summary page and emails.
\ No newline at end of file