Skip to content

Commit

Permalink
[BUGFIX] Exclude hidden fields within summary pages and mails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
waldhacker1 authored and benjaminkott committed Apr 17, 2018
1 parent 197db50 commit fb6715b
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 1 deletion.
Expand Up @@ -84,11 +84,14 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl

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
Expand Down
4 changes: 4 additions & 0 deletions typo3/sysext/form/Configuration/Yaml/BaseSetup.yaml
Expand Up @@ -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:
Expand Down
Expand Up @@ -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:
Expand Down Expand Up @@ -1619,6 +1621,8 @@ Full default configuration
containerClassAttribute: input
elementClassAttribute: ''
elementErrorClassAttribute: error
renderingOptions:
_isHiddenFormElement: true
Checkbox:
formEditor:
editors:
Expand Down
Expand Up @@ -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

Expand Down
@@ -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.
Expand Up @@ -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

Expand Down
@@ -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.

0 comments on commit fb6715b

Please sign in to comment.