[BUGFIX] Nested flexforms no longer throw exception 90/30590/7
authorThomas Christiansen <thomas.christiansen@e-net.info>
Thu, 5 Jun 2014 13:33:53 +0000 (15:33 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 20 Jun 2014 12:10:08 +0000 (14:10 +0200)
This patch prevents nested flexforms from throwing
an exception on saving or opening the record.

Resolves: #59368
Releases: 6.2

Change-Id: Iadeeecc3aef92b8bcc4f7fe4e22882d924f10a50
Reviewed-on: https://review.typo3.org/30590
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/backend/Classes/Form/DataPreprocessor.php
typo3/sysext/core/Classes/Database/ReferenceIndex.php

index 180702c..73fe729 100644 (file)
@@ -451,7 +451,11 @@ class DataPreprocessor {
         */
        public function renderRecord_flexProc($data, $fieldConfig, $TSconfig, $table, $row, $field) {
                // Convert the XML data to PHP array:
-               $currentValueArray = GeneralUtility::xml2array($data);
+               if (!is_array($data)) {
+                       $currentValueArray = GeneralUtility::xml2array($data);
+               } else {
+                       $currentValueArray = $data;
+               }
                if (is_array($currentValueArray)) {
                        // Get current value array:
                        $dataStructArray = BackendUtility::getFlexFormDS($fieldConfig['config'], $row, $table, $field);
index 7252247..3620d40 100644 (file)
@@ -510,7 +510,7 @@ class ReferenceIndex {
                        $this->temp_flexRelations['db'][$structurePath] = $resultsFromDatabase;
                }
                // Soft References:
-               if (strlen($dataValue) && ($softRefs = BackendUtility::explodeSoftRefParserList($dsConf['softref']))) {
+               if ((is_array($dataValue) || strlen($dataValue)) && $softRefs = BackendUtility::explodeSoftRefParserList($dsConf['softref'])) {
                        $softRefValue = $dataValue;
                        foreach ($softRefs as $spKey => $spParams) {
                                $softRefObj = BackendUtility::softRefParserObj($spKey);