[TASK] Move FlexFormService from EXT:extbase to EXT:core 54/57854/3
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 10 Aug 2018 09:56:02 +0000 (11:56 +0200)
committerBenni Mack <benni@typo3.org>
Sat, 11 Aug 2018 11:28:42 +0000 (13:28 +0200)
Resolves: #85802
Releases: master
Change-Id: I878bb4552ae8709ed4a1ec32afdfbfd7abaaa2e6
Reviewed-on: https://review.typo3.org/57854
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
13 files changed:
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/core/Classes/Resource/ResourceFactory.php
typo3/sysext/core/Classes/Service/FlexFormService.php [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Deprecation-85802-MoveFlexFormServiceFromEXTextbaseToEXTcore.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Service/FlexFormServiceTest.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php
typo3/sysext/extbase/Classes/Service/FlexFormService.php [deleted file]
typo3/sysext/extbase/Migrations/Code/ClassAliasMap.php
typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php
typo3/sysext/extbase/Tests/Unit/Service/FlexFormServiceTest.php [deleted file]
typo3/sysext/form/Classes/Hooks/FormPagePreviewRenderer.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php

index 39d32eb..562407f 100644 (file)
@@ -40,6 +40,7 @@ use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Service\DependencyOrderingService;
+use TYPO3\CMS\Core\Service\FlexFormService;
 use TYPO3\CMS\Core\Type\Bitmask\Permission;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -47,7 +48,6 @@ use TYPO3\CMS\Core\Utility\HttpUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Core\Utility\StringUtility;
 use TYPO3\CMS\Core\Versioning\VersionState;
-use TYPO3\CMS\Extbase\Service\FlexFormService;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 use TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList;
 
index f7dfdfe..4c461c6 100644 (file)
@@ -19,10 +19,10 @@ use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
 use TYPO3\CMS\Core\Resource\Index\FileIndexRepository;
+use TYPO3\CMS\Core\Service\FlexFormService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Core\Utility\PathUtility;
-use TYPO3\CMS\Extbase\Service\FlexFormService;
 use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
 
 // @todo implement constructor-level caching
diff --git a/typo3/sysext/core/Classes/Service/FlexFormService.php b/typo3/sysext/core/Classes/Service/FlexFormService.php
new file mode 100644 (file)
index 0000000..c2ee8dc
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+namespace TYPO3\CMS\Core\Service;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Utilities to process flexForms
+ */
+class FlexFormService implements \TYPO3\CMS\Core\SingletonInterface
+{
+    /**
+     * Parses the flexForm content and converts it to an array
+     * The resulting array will be multi-dimensional, as a value "bla.blubb"
+     * results in two levels, and a value "bla.blubb.bla" results in three levels.
+     *
+     * Note: multi-language flexForms are not supported yet
+     *
+     * @param string $flexFormContent flexForm xml string
+     * @param string $languagePointer language pointer used in the flexForm
+     * @param string $valuePointer value pointer used in the flexForm
+     * @return array the processed array
+     */
+    public function convertFlexFormContentToArray($flexFormContent, $languagePointer = 'lDEF', $valuePointer = 'vDEF')
+    {
+        $settings = [];
+        $flexFormArray = \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($flexFormContent);
+        $flexFormArray = $flexFormArray['data'] ?? [];
+        foreach (array_values($flexFormArray) as $languages) {
+            if (!is_array($languages[$languagePointer])) {
+                continue;
+            }
+            foreach ($languages[$languagePointer] as $valueKey => $valueDefinition) {
+                if (strpos($valueKey, '.') === false) {
+                    $settings[$valueKey] = $this->walkFlexFormNode($valueDefinition, $valuePointer);
+                } else {
+                    $valueKeyParts = explode('.', $valueKey);
+                    $currentNode = &$settings;
+                    foreach ($valueKeyParts as $valueKeyPart) {
+                        $currentNode = &$currentNode[$valueKeyPart];
+                    }
+                    if (is_array($valueDefinition)) {
+                        if (array_key_exists($valuePointer, $valueDefinition)) {
+                            $currentNode = $valueDefinition[$valuePointer];
+                        } else {
+                            $currentNode = $this->walkFlexFormNode($valueDefinition, $valuePointer);
+                        }
+                    } else {
+                        $currentNode = $valueDefinition;
+                    }
+                }
+            }
+        }
+        return $settings;
+    }
+
+    /**
+     * Parses a flexForm node recursively and takes care of sections etc
+     *
+     * @param array $nodeArray The flexForm node to parse
+     * @param string $valuePointer The valuePointer to use for value retrieval
+     * @return array
+     */
+    public function walkFlexFormNode($nodeArray, $valuePointer = 'vDEF')
+    {
+        if (is_array($nodeArray)) {
+            $return = [];
+            foreach ($nodeArray as $nodeKey => $nodeValue) {
+                if ($nodeKey === $valuePointer) {
+                    return $nodeValue;
+                }
+                if (in_array($nodeKey, ['el', '_arrayContainer'])) {
+                    return $this->walkFlexFormNode($nodeValue, $valuePointer);
+                }
+                if ($nodeKey[0] === '_') {
+                    continue;
+                }
+                if (strpos($nodeKey, '.')) {
+                    $nodeKeyParts = explode('.', $nodeKey);
+                    $currentNode = &$return;
+                    $nodeKeyPartsCount = count($nodeKeyParts);
+                    for ($i = 0; $i < $nodeKeyPartsCount - 1; $i++) {
+                        $currentNode = &$currentNode[$nodeKeyParts[$i]];
+                    }
+                    $newNode = [next($nodeKeyParts) => $nodeValue];
+                    $subVal = $this->walkFlexFormNode($newNode, $valuePointer);
+                    $currentNode[key($subVal)] = current($subVal);
+                } elseif (is_array($nodeValue)) {
+                    if (array_key_exists($valuePointer, $nodeValue)) {
+                        $return[$nodeKey] = $nodeValue[$valuePointer];
+                    } else {
+                        $return[$nodeKey] = $this->walkFlexFormNode($nodeValue, $valuePointer);
+                    }
+                } else {
+                    $return[$nodeKey] = $nodeValue;
+                }
+            }
+            return $return;
+        }
+        return $nodeArray;
+    }
+}
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85802-MoveFlexFormServiceFromEXTextbaseToEXTcore.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85802-MoveFlexFormServiceFromEXTextbaseToEXTcore.rst
new file mode 100644 (file)
index 0000000..28abfb5
--- /dev/null
@@ -0,0 +1,34 @@
+.. include:: ../../Includes.txt
+
+=======================================================================
+Deprecation: #85802 - Move FlexFormService from EXT:extbase to EXT:core
+=======================================================================
+
+See :issue:`85802`
+
+Description
+===========
+
+Move FlexFormService from EXT:extbase to EXT:core
+
+
+Impact
+======
+
+The PHP class :php:`TYPO3\CMS\Extbase\Service\FlexFormService` has been moved from the system
+extension `extbase` to `core`. The PHP class has been renamed to
+:php:`TYPO3\CMS\Core\Service\FlexFormService`.
+
+
+Affected Installations
+======================
+
+Any TYPO3 installation where this PHP class is in use within a TYPO3 extension.
+
+
+Migration
+=========
+
+Use the new namespace to reference the :php:`TYPO3\CMS\Core\Service\FlexFormService`
+
+.. index:: PHP-API, FullyScanned, ext:extbase
\ No newline at end of file
diff --git a/typo3/sysext/core/Tests/Unit/Service/FlexFormServiceTest.php b/typo3/sysext/core/Tests/Unit/Service/FlexFormServiceTest.php
new file mode 100644 (file)
index 0000000..3d83def
--- /dev/null
@@ -0,0 +1,118 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Unit\Service;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
+
+/**
+ * Test case
+ */
+class FlexFormServiceTest extends UnitTestCase
+{
+    /**
+     * @var bool Reset singletons created by subject
+     */
+    protected $resetSingletonInstances = true;
+
+    /**
+     * @test
+     */
+    public function convertFlexFormContentToArrayResolvesComplexArrayStructure()
+    {
+        $input = '<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
+<T3FlexForms>
+       <data>
+               <sheet index="sDEF">
+                       <language index="lDEF">
+                               <field index="settings.foo">
+                                       <value index="vDEF">Foo-Value</value>
+                               </field>
+                               <field index="settings.bar">
+                                       <el index="el">
+                                               <section index="1">
+                                                       <itemType index="_arrayContainer">
+                                                               <el>
+                                                                       <field index="baz">
+                                                                               <value index="vDEF">Baz1-Value</value>
+                                                                       </field>
+                                                                       <field index="bum">
+                                                                               <value index="vDEF">Bum1-Value</value>
+                                                                       </field>
+                                                                       <field index="dot.one">
+                                                                               <value index="vDEF">dot.one-Value</value>
+                                                                       </field>
+                                                                       <field index="dot.two">
+                                                                               <value index="vDEF">dot.two-Value</value>
+                                                                       </field>
+                                                               </el>
+                                                       </itemType>
+                                                       <itemType index="_TOGGLE">0</itemType>
+                                               </section>
+                                               <section index="2">
+                                                       <itemType index="_arrayContainer">
+                                                               <el>
+                                                                       <field index="baz">
+                                                                               <value index="vDEF">Baz2-Value</value>
+                                                                       </field>
+                                                                       <field index="bum">
+                                                                               <value index="vDEF">Bum2-Value</value>
+                                                                       </field>
+                                                               </el>
+                                                       </itemType>
+                                                       <itemType index="_TOGGLE">0</itemType>
+                                               </section>
+                                       </el>
+                               </field>
+                       </language>
+               </sheet>
+       </data>
+</T3FlexForms>';
+
+        $expected = [
+            'settings' => [
+                'foo' => 'Foo-Value',
+                'bar' => [
+                    1 => [
+                        'baz' => 'Baz1-Value',
+                        'bum' => 'Bum1-Value',
+                        'dot' => [
+                            'one' => 'dot.one-Value',
+                            'two' => 'dot.two-Value',
+                        ],
+                    ],
+                    2 => [
+                        'baz' => 'Baz2-Value',
+                        'bum' => 'Bum2-Value'
+                    ]
+                ]
+            ]
+        ];
+
+        // The subject calls xml2array statically, which calls getHash and setHash statically, which uses
+        // caches, those need to be mocked.
+        $cacheManagerMock = $this->createMock(\TYPO3\CMS\Core\Cache\CacheManager::class);
+        $cacheMock = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::class);
+        $cacheManagerMock->expects($this->any())->method('getCache')->will($this->returnValue($cacheMock));
+        GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Cache\CacheManager::class, $cacheManagerMock);
+
+        $flexFormService = $this->getMockBuilder(\TYPO3\CMS\Core\Service\FlexFormService::class)
+            ->setMethods(['dummy'])
+            ->disableOriginalConstructor()
+            ->getMock();
+        $convertedFlexFormArray = $flexFormService->convertFlexFormContentToArray($input);
+        $this->assertSame($expected, $convertedFlexFormArray);
+    }
+}
index 0326121..38f0894 100644 (file)
@@ -25,14 +25,14 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 class FrontendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager
 {
     /**
-     * @var \TYPO3\CMS\Extbase\Service\FlexFormService
+     * @var \TYPO3\CMS\Core\Service\FlexFormService
      */
     protected $flexFormService;
 
     /**
-     * @param \TYPO3\CMS\Extbase\Service\FlexFormService $flexFormService
+     * @param \TYPO3\CMS\Core\Service\FlexFormService $flexFormService
      */
-    public function injectFlexFormService(\TYPO3\CMS\Extbase\Service\FlexFormService $flexFormService)
+    public function injectFlexFormService(\TYPO3\CMS\Core\Service\FlexFormService $flexFormService)
     {
         $this->flexFormService = $flexFormService;
     }
diff --git a/typo3/sysext/extbase/Classes/Service/FlexFormService.php b/typo3/sysext/extbase/Classes/Service/FlexFormService.php
deleted file mode 100644 (file)
index ad68280..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Service;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Utilities to process flexForms
- */
-class FlexFormService implements \TYPO3\CMS\Core\SingletonInterface
-{
-    /**
-     * Parses the flexForm content and converts it to an array
-     * The resulting array will be multi-dimensional, as a value "bla.blubb"
-     * results in two levels, and a value "bla.blubb.bla" results in three levels.
-     *
-     * Note: multi-language flexForms are not supported yet
-     *
-     * @param string $flexFormContent flexForm xml string
-     * @param string $languagePointer language pointer used in the flexForm
-     * @param string $valuePointer value pointer used in the flexForm
-     * @return array the processed array
-     */
-    public function convertFlexFormContentToArray($flexFormContent, $languagePointer = 'lDEF', $valuePointer = 'vDEF')
-    {
-        $settings = [];
-        $flexFormArray = \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($flexFormContent);
-        $flexFormArray = $flexFormArray['data'] ?? [];
-        foreach (array_values($flexFormArray) as $languages) {
-            if (!is_array($languages[$languagePointer])) {
-                continue;
-            }
-            foreach ($languages[$languagePointer] as $valueKey => $valueDefinition) {
-                if (strpos($valueKey, '.') === false) {
-                    $settings[$valueKey] = $this->walkFlexFormNode($valueDefinition, $valuePointer);
-                } else {
-                    $valueKeyParts = explode('.', $valueKey);
-                    $currentNode = &$settings;
-                    foreach ($valueKeyParts as $valueKeyPart) {
-                        $currentNode = &$currentNode[$valueKeyPart];
-                    }
-                    if (is_array($valueDefinition)) {
-                        if (array_key_exists($valuePointer, $valueDefinition)) {
-                            $currentNode = $valueDefinition[$valuePointer];
-                        } else {
-                            $currentNode = $this->walkFlexFormNode($valueDefinition, $valuePointer);
-                        }
-                    } else {
-                        $currentNode = $valueDefinition;
-                    }
-                }
-            }
-        }
-        return $settings;
-    }
-
-    /**
-     * Parses a flexForm node recursively and takes care of sections etc
-     *
-     * @param array $nodeArray The flexForm node to parse
-     * @param string $valuePointer The valuePointer to use for value retrieval
-     * @return array
-     */
-    public function walkFlexFormNode($nodeArray, $valuePointer = 'vDEF')
-    {
-        if (is_array($nodeArray)) {
-            $return = [];
-            foreach ($nodeArray as $nodeKey => $nodeValue) {
-                if ($nodeKey === $valuePointer) {
-                    return $nodeValue;
-                }
-                if (in_array($nodeKey, ['el', '_arrayContainer'])) {
-                    return $this->walkFlexFormNode($nodeValue, $valuePointer);
-                }
-                if ($nodeKey[0] === '_') {
-                    continue;
-                }
-                if (strpos($nodeKey, '.')) {
-                    $nodeKeyParts = explode('.', $nodeKey);
-                    $currentNode = &$return;
-                    $nodeKeyPartsCount = count($nodeKeyParts);
-                    for ($i = 0; $i < $nodeKeyPartsCount - 1; $i++) {
-                        $currentNode = &$currentNode[$nodeKeyParts[$i]];
-                    }
-                    $newNode = [next($nodeKeyParts) => $nodeValue];
-                    $subVal = $this->walkFlexFormNode($newNode, $valuePointer);
-                    $currentNode[key($subVal)] = current($subVal);
-                } elseif (is_array($nodeValue)) {
-                    if (array_key_exists($valuePointer, $nodeValue)) {
-                        $return[$nodeKey] = $nodeValue[$valuePointer];
-                    } else {
-                        $return[$nodeKey] = $this->walkFlexFormNode($nodeValue, $valuePointer);
-                    }
-                } else {
-                    $return[$nodeKey] = $nodeValue;
-                }
-            }
-            return $return;
-        }
-        return $nodeArray;
-    }
-}
index 3c8da79..2e7255b 100644 (file)
@@ -56,5 +56,8 @@ return [
 
     // Fluid
     'TYPO3\\CMS\\Extbase\\Mvc\\Exception\\InvalidViewHelperException' => \TYPO3\CMS\Extbase\Exception::class,
-    'TYPO3\\CMS\\Extbase\\Mvc\\Exception\\InvalidTemplateResourceException' => \TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException::class
+    'TYPO3\\CMS\\Extbase\\Mvc\\Exception\\InvalidTemplateResourceException' => \TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException::class,
+
+    // Service
+    'TYPO3\\CMS\\Extbase\\Service\\FlexFormService' => \TYPO3\CMS\Core\Service\FlexFormService::class,
 ];
index 9f51f37..66d5449 100644 (file)
@@ -15,10 +15,11 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Configuration;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
+use TYPO3\CMS\Core\Service\FlexFormService;
 use TYPO3\CMS\Core\TypoScript\TypoScriptService;
 use TYPO3\CMS\Extbase\Configuration\Exception\ParseErrorException;
 use TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager;
-use TYPO3\CMS\Extbase\Service\FlexFormService;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
diff --git a/typo3/sysext/extbase/Tests/Unit/Service/FlexFormServiceTest.php b/typo3/sysext/extbase/Tests/Unit/Service/FlexFormServiceTest.php
deleted file mode 100644 (file)
index 47221f3..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Service;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
-
-/**
- * Test case
- */
-class FlexFormServiceTest extends UnitTestCase
-{
-    /**
-     * @var bool Reset singletons created by subject
-     */
-    protected $resetSingletonInstances = true;
-
-    /**
-     * @test
-     */
-    public function convertFlexFormContentToArrayResolvesComplexArrayStructure()
-    {
-        $input = '<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
-<T3FlexForms>
-       <data>
-               <sheet index="sDEF">
-                       <language index="lDEF">
-                               <field index="settings.foo">
-                                       <value index="vDEF">Foo-Value</value>
-                               </field>
-                               <field index="settings.bar">
-                                       <el index="el">
-                                               <section index="1">
-                                                       <itemType index="_arrayContainer">
-                                                               <el>
-                                                                       <field index="baz">
-                                                                               <value index="vDEF">Baz1-Value</value>
-                                                                       </field>
-                                                                       <field index="bum">
-                                                                               <value index="vDEF">Bum1-Value</value>
-                                                                       </field>
-                                                                       <field index="dot.one">
-                                                                               <value index="vDEF">dot.one-Value</value>
-                                                                       </field>
-                                                                       <field index="dot.two">
-                                                                               <value index="vDEF">dot.two-Value</value>
-                                                                       </field>
-                                                               </el>
-                                                       </itemType>
-                                                       <itemType index="_TOGGLE">0</itemType>
-                                               </section>
-                                               <section index="2">
-                                                       <itemType index="_arrayContainer">
-                                                               <el>
-                                                                       <field index="baz">
-                                                                               <value index="vDEF">Baz2-Value</value>
-                                                                       </field>
-                                                                       <field index="bum">
-                                                                               <value index="vDEF">Bum2-Value</value>
-                                                                       </field>
-                                                               </el>
-                                                       </itemType>
-                                                       <itemType index="_TOGGLE">0</itemType>
-                                               </section>
-                                       </el>
-                               </field>
-                       </language>
-               </sheet>
-       </data>
-</T3FlexForms>';
-
-        $expected = [
-            'settings' => [
-                'foo' => 'Foo-Value',
-                'bar' => [
-                    1 => [
-                        'baz' => 'Baz1-Value',
-                        'bum' => 'Bum1-Value',
-                        'dot' => [
-                            'one' => 'dot.one-Value',
-                            'two' => 'dot.two-Value',
-                        ],
-                    ],
-                    2 => [
-                        'baz' => 'Baz2-Value',
-                        'bum' => 'Bum2-Value'
-                    ]
-                ]
-            ]
-        ];
-
-        // The subject calls xml2array statically, which calls getHash and setHash statically, which uses
-        // caches, those need to be mocked.
-        $cacheManagerMock = $this->createMock(\TYPO3\CMS\Core\Cache\CacheManager::class);
-        $cacheMock = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::class);
-        $cacheManagerMock->expects($this->any())->method('getCache')->will($this->returnValue($cacheMock));
-        GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Cache\CacheManager::class, $cacheManagerMock);
-
-        $flexFormService = $this->getMockBuilder(\TYPO3\CMS\Extbase\Service\FlexFormService::class)
-            ->setMethods(['dummy'])
-            ->disableOriginalConstructor()
-            ->getMock();
-        $convertedFlexFormArray = $flexFormService->convertFlexFormContentToArray($input);
-        $this->assertSame($expected, $convertedFlexFormArray);
-    }
-}
index 3fe0f5e..a324108 100644 (file)
@@ -21,10 +21,10 @@ use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Messaging\AbstractMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
+use TYPO3\CMS\Core\Service\FlexFormService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\StringUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
-use TYPO3\CMS\Extbase\Service\FlexFormService;
 use TYPO3\CMS\Form\Mvc\Configuration\Exception\NoSuchFileException;
 use TYPO3\CMS\Form\Mvc\Configuration\Exception\ParseErrorException;
 use TYPO3\CMS\Form\Mvc\Persistence\Exception\PersistenceManagerException;
index 656b6f8..fba7790 100644 (file)
@@ -44,6 +44,7 @@ use TYPO3\CMS\Core\Resource\ProcessedFile;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Resource\StorageRepository;
 use TYPO3\CMS\Core\Service\DependencyOrderingService;
+use TYPO3\CMS\Core\Service\FlexFormService;
 use TYPO3\CMS\Core\Service\MarkerBasedTemplateService;
 use TYPO3\CMS\Core\TimeTracker\TimeTracker;
 use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser;
@@ -56,7 +57,6 @@ use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Core\Utility\PathUtility;
 use TYPO3\CMS\Core\Utility\StringUtility;
 use TYPO3\CMS\Core\Versioning\VersionState;
-use TYPO3\CMS\Extbase\Service\FlexFormService;
 use TYPO3\CMS\Frontend\ContentObject\Exception\ContentRenderingException;
 use TYPO3\CMS\Frontend\ContentObject\Exception\ExceptionHandlerInterface;
 use TYPO3\CMS\Frontend\ContentObject\Exception\ProductionExceptionHandler;
index 605ea45..79fe95e 100644 (file)
@@ -714,4 +714,9 @@ return [
             'Deprecation-85761-DeprecatedSaltedPasswordService.rst',
         ],
     ],
+    'TYPO3\CMS\Extbase\Service\FlexFormService' => [
+        'restFiles' => [
+            'Deprecation-85802-MoveFlexFormServiceFromEXTextbaseToEXTcore.rst',
+        ],
+    ],
 ];