[BUGFIX] Handle formEngine add wizard select in flex forms 38/58338/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 19 Sep 2018 10:27:58 +0000 (12:27 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 19 Sep 2018 14:13:49 +0000 (16:13 +0200)
addRecord fieldControl fails for type=select fields
in flex forms in AddController since existing values
are not resolved to an array structure as it is done
for type=group fields. Handle that case.

Resolves: #86313
Related: #82049
Releases: master, 8.7
Change-Id: I59e6cb1c11adf1ac7ebaf0293daad24aa1fd01b4
Reviewed-on: https://review.typo3.org/58338
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/Controller/Wizard/AddController.php

index 2695b61..6d0fc7f 100644 (file)
@@ -209,7 +209,13 @@ class AddController extends AbstractWizardController
                         // Compile currentFlexFormData to functional string
                         $currentFlexFormValues = [];
                         foreach ($currentFlexFormValueByPath as $value) {
-                            $currentFlexFormValues[] = $value['table'] . '_' . $value['uid'];
+                            if (is_array($value)) {
+                                // group fields are always resolved to array
+                                $currentFlexFormValues[] = $value['table'] . '_' . $value['uid'];
+                            } else {
+                                // but select fields may be uids only
+                                $currentFlexFormValues[] = $value;
+                            }
                         }
                         $currentFlexFormValue = implode(',', $currentFlexFormValues);