[TASK] Use FlexFormService to convert FAL driver configuration 19/44719/2
authorOliver Eglseder <oliver.eglseder@in2code.de>
Sat, 14 Nov 2015 17:59:21 +0000 (18:59 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Fri, 20 Nov 2015 10:55:17 +0000 (11:55 +0100)
This replaces the custom FlexForm converting Method of the ResourceFactory
with a technically mature and more suitable method from FlexForm Service,
which allows multiple sheets in FlexForms, instead of just a flat structure.

Resolves: #71577
Releases: master
Change-Id: Idea72b36f6b97b8b1248d8678878cc23e43acdab
Reviewed-on: https://review.typo3.org/44719
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/Resource/ResourceFactory.php

index bbe339a..d6025cb 100644 (file)
@@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Resource\Index\FileIndexRepository;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Core\Utility\PathUtility;
+use TYPO3\CMS\Extbase\Service\FlexFormService;
 
 // @todo implement constructor-level caching
 /**
@@ -248,14 +249,8 @@ class ResourceFactory implements ResourceFactoryInterface, \TYPO3\CMS\Core\Singl
     {
         $configuration = array();
         if ($flexFormData) {
-            $flexFormContents = GeneralUtility::xml2array($flexFormData);
-            if (!empty($flexFormContents['data']['sDEF']['lDEF']) && is_array($flexFormContents['data']['sDEF']['lDEF'])) {
-                foreach ($flexFormContents['data']['sDEF']['lDEF'] as $key => $value) {
-                    if (isset($value['vDEF'])) {
-                        $configuration[$key] = $value['vDEF'];
-                    }
-                }
-            }
+            $flexFormService = GeneralUtility::makeInstance(FlexFormService::class);
+            $configuration = $flexFormService->convertFlexFormContentToArray($flexFormData);
         }
         return $configuration;
     }