[BUGFIX] Exclude hidden fields within summary pages and mails 59/56359/5
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Sun, 18 Mar 2018 12:05:35 +0000 (13:05 +0100)
committerBenjamin Kott <benjamin.kott@outlook.com>
Tue, 17 Apr 2018 22:02:33 +0000 (00:02 +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/56359
Reviewed-by: Björn Jacob <bjoern.jacob@tritum.de>
Tested-by: Björn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Kay Strobach <typo3@kay-strobach.de>
Tested-by: Kay Strobach <typo3@kay-strobach.de>
Reviewed-by: Benjamin Kott <benjamin.kott@outlook.com>
Tested-by: Benjamin Kott <benjamin.kott@outlook.com>
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/Hidden/_isHiddenFormElement.rst [new file with mode: 0644]
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Honeypot.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Honeypot/_isHiddenFormElement.rst [new file with mode: 0644]

index 53b5156..3e5f704 100644 (file)
@@ -84,12 +84,15 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
 
             if (
                 !$element instanceof FormElementInterface
-                || $element->getType() === 'Honeypot'
                 || (
                     isset($renderingOptions['_isCompositeFormElement'])
                     && $renderingOptions['_isCompositeFormElement'] === true
                 )
                 || (
+                    isset($renderingOptions['_isHiddenFormElement'])
+                    && $renderingOptions['_isHiddenFormElement'] === true
+                )
+                || (
                     isset($renderingOptions['_isReadOnlyFormElement'])
                     && $renderingOptions['_isReadOnlyFormElement'] === true
                 )
index 69e8041..0af6a00 100644 (file)
@@ -152,10 +152,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: SELECT ###
             Checkbox:
index 8bc5afe..dad6cbe 100644 (file)
@@ -1567,6 +1567,8 @@ Full default configuration
               elementErrorClassAttribute: error
               renderAsHiddenField: false
               styleAttribute: 'position:absolute; margin:0 0 0 -999em;'
+            renderingOptions:
+              _isHiddenFormElement: true
           Hidden:
             formEditor:
               editors:
@@ -1619,6 +1621,8 @@ Full default configuration
               containerClassAttribute: input
               elementClassAttribute: ''
               elementErrorClassAttribute: error
+            renderingOptions:
+              _isHiddenFormElement: true
           Checkbox:
             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
 
diff --git a/typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Hidden/_isHiddenFormElement.rst b/typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Hidden/_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
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/proto/formElements/formElementTypes/Honeypot/_isHiddenFormElement.rst b/typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/Honeypot/_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