[BUGFIX] EXT:form - "label" is not set for the FormDefinition class 25/54425/2
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Thu, 28 Sep 2017 08:09:57 +0000 (10:09 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 17 Oct 2017 22:43:08 +0000 (00:43 +0200)
Set the "label" property for the root form element
TYPO3\CMS\Form\Domain\Model\FormDefinition

Resolves: #82573
Releases: master,8.7
Change-Id: I57c45765e4af91da6094f8f7a469a1df2f6da1f5
Reviewed-on: https://review.typo3.org/54425
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/form/Classes/Domain/Factory/ArrayFormFactory.php
typo3/sysext/form/Classes/Domain/Model/FormDefinition.php

index 4a05515..4e6c6b2 100644 (file)
@@ -71,7 +71,6 @@ class ArrayFormFactory extends AbstractFormFactory
         unset($configuration['renderables']);
         unset($configuration['type']);
         unset($configuration['identifier']);
-        unset($configuration['label']);
         $form->setOptions($configuration);
 
         $this->triggerFormBuildingFinished($form);
index e496c68..fdc79a9 100644 (file)
@@ -349,6 +349,9 @@ class FormDefinition extends AbstractCompositeRenderable
         if (isset($options['rendererClassName'])) {
             $this->setRendererClassName($options['rendererClassName']);
         }
+        if (isset($options['label'])) {
+            $this->setLabel($options['label']);
+        }
         if (isset($options['renderingOptions'])) {
             foreach ($options['renderingOptions'] as $key => $value) {
                 if (is_array($value)) {
@@ -368,7 +371,7 @@ class FormDefinition extends AbstractCompositeRenderable
 
         ArrayUtility::assertAllArrayKeysAreValid(
             $options,
-            ['rendererClassName', 'renderingOptions', 'finishers', 'formEditor']
+            ['rendererClassName', 'renderingOptions', 'finishers', 'formEditor', 'label']
         );
     }