From b3190c3b8eb2b45f369ace8a67f417e147e41977 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Sat, 16 Sep 2017 00:55:34 +0200 Subject: [PATCH] [!!!][BUGFIX] Fix wrong error path of validation Add the form name as top level property to the validation results to let the form field viewhelper attribute "errorClass" work. Releases: master, 8.7 Resolves: #82093 Change-Id: I2d1c0845c5ab15d68393d5b491bf26db8f3f17c0 Reviewed-on: https://review.typo3.org/54150 Reviewed-by: Mathias Schreiber Tested-by: Mathias Schreiber Tested-by: TYPO3com Reviewed-by: Benjamin Kott Tested-by: Benjamin Kott --- ...aking-82093-ExtFormFieldPartialChanged.rst | 57 +++++++++++++++++++ ...aking-82093-ExtFormFieldPartialChanged.rst | 57 +++++++++++++++++++ .../Classes/Domain/Runtime/FormRuntime.php | 2 +- .../Frontend/Partials/Field/Field.html | 2 +- 4 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 typo3/sysext/core/Documentation/Changelog/8.7.x/Breaking-82093-ExtFormFieldPartialChanged.rst create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Breaking-82093-ExtFormFieldPartialChanged.rst diff --git a/typo3/sysext/core/Documentation/Changelog/8.7.x/Breaking-82093-ExtFormFieldPartialChanged.rst b/typo3/sysext/core/Documentation/Changelog/8.7.x/Breaking-82093-ExtFormFieldPartialChanged.rst new file mode 100644 index 000000000000..5c4c94b5e008 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/8.7.x/Breaking-82093-ExtFormFieldPartialChanged.rst @@ -0,0 +1,57 @@ +.. include:: ../../Includes.txt + +================================================================= +Breaking: #82093 - EXT:form Partials/Field/Field.html has changed +================================================================= + +See :issue:`82093` + +Description +=========== + +To let the form field viewhelper attribute errorClass work, the partial +"EXT:form/Resources/Private/Frontend/Partials/Field/Field.html" has been changed. + +.. code-block:: html + + + +has been changed to + +.. code-block:: html + + + + +Impact +====== + +Users who overwrite this partial by its own partial have to make adjustments. +Otherwise no "has-error" class will be rendered in case of form validation errors +into the parents
and the +content will not be rendered. + + +Affected Installations +====================== + +All installations with overwritten partial "EXT:form/Resources/Private/Frontend/Partials/Field/Field.html" + + +Migration +========= + +Change the partial Field/Field.html within your site package. + +.. code-block:: html + + + +change to + +.. code-block:: html + + + + +.. index:: Frontend, ext:form, NotScanned diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-82093-ExtFormFieldPartialChanged.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-82093-ExtFormFieldPartialChanged.rst new file mode 100644 index 000000000000..5c4c94b5e008 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-82093-ExtFormFieldPartialChanged.rst @@ -0,0 +1,57 @@ +.. include:: ../../Includes.txt + +================================================================= +Breaking: #82093 - EXT:form Partials/Field/Field.html has changed +================================================================= + +See :issue:`82093` + +Description +=========== + +To let the form field viewhelper attribute errorClass work, the partial +"EXT:form/Resources/Private/Frontend/Partials/Field/Field.html" has been changed. + +.. code-block:: html + + + +has been changed to + +.. code-block:: html + + + + +Impact +====== + +Users who overwrite this partial by its own partial have to make adjustments. +Otherwise no "has-error" class will be rendered in case of form validation errors +into the parents
and the +content will not be rendered. + + +Affected Installations +====================== + +All installations with overwritten partial "EXT:form/Resources/Private/Frontend/Partials/Field/Field.html" + + +Migration +========= + +Change the partial Field/Field.html within your site package. + +.. code-block:: html + + + +change to + +.. code-block:: html + + + + +.. index:: Frontend, ext:form, NotScanned diff --git a/typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php b/typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php index 275dcec93659..8433518c6883 100644 --- a/typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php +++ b/typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php @@ -482,7 +482,7 @@ class FormRuntime implements RootRenderableInterface, \ArrayAccess $exception ); } - $result->forProperty($propertyPath)->merge($processingRule->getProcessingMessages()); + $result->forProperty($this->getIdentifier() . '.' . $propertyPath)->merge($processingRule->getProcessingMessages()); $this->formState->setFormValue($propertyPath, $value); } } diff --git a/typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Field.html b/typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Field.html index 6b1107ed216e..3b01de7f5165 100644 --- a/typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Field.html +++ b/typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Field.html @@ -1,5 +1,5 @@ - +
-- 2.20.1