[BUGFIX] Ensure t3d compatibility for supported TYPO3 version 90/47090/2
authorNicole Cordes <typo3@cordes.co>
Fri, 4 Mar 2016 09:33:48 +0000 (10:33 +0100)
committerNicole Cordes <typo3@cordes.co>
Sat, 5 Mar 2016 18:13:35 +0000 (19:13 +0100)
This patch fixes an issue with unclean t3d export due to string to array
conversion. This is important to be able to import a t3d files which was
exported with 7.6 and above even in 6.2. This is needed as we do not
have any chance to see which TYPO3 version was used for the export.

Resolves: #74127
Releases: master, 7.6, 6.2
Change-Id: I6ba7b825241c2ca439c485aaf597b019b7ac8997
Reviewed-on: https://review.typo3.org/47090
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/Classes/Import.php
typo3/sysext/impexp/Classes/ImportExport.php

index 39b96d9..fffcbc2 100644 (file)
@@ -352,7 +352,7 @@ class ImportExportController extends BaseScriptClass
         $this->export->maxFileSize = $inData['maxFileSize'] * 1024;
         $this->export->excludeMap = (array)$inData['exclude'];
         $this->export->softrefCfg = (array)$inData['softrefCfg'];
-        $this->export->extensionDependencies = (array)$inData['extension_dep'];
+        $this->export->extensionDependencies = ($inData['extension_dep'] === '') ? array() : (array)$inData['extension_dep'];
         $this->export->showStaticRelations = $inData['showStaticRelations'];
         $this->export->includeExtFileResources = !$inData['excludeHTMLfileResources'];
 
index 897ab75..ee9fb0e 100644 (file)
@@ -343,7 +343,7 @@ class Import extends ImportExport
         // Check #1: Extension dependencies
         $extKeysToInstall = array();
         foreach ($this->dat['header']['extensionDependencies'] as $extKey) {
-            if (!ExtensionManagementUtility::isLoaded($extKey)) {
+            if (!empty($extKey) && !ExtensionManagementUtility::isLoaded($extKey)) {
                 $extKeysToInstall[] = $extKey;
             }
         }
@@ -2132,7 +2132,6 @@ class Import extends ImportExport
      */
     public function loadInit()
     {
-        $this->cleanupImportData();
         $this->relStaticTables = (array)$this->dat['header']['relStaticTables'];
         $this->excludeMap = (array)$this->dat['header']['excludeMap'];
         $this->softrefCfg = (array)$this->dat['header']['softrefCfg'];
@@ -2147,20 +2146,6 @@ class Import extends ImportExport
     }
 
     /**
-     * Cleanses any inconsistent states which can occur in imported T3D/XML
-     *
-     * @return void
-     */
-    protected function cleanupImportData()
-    {
-        if (isset($this->dat['header']['extensionDependencies']) && is_array($this->dat['header']['extensionDependencies'])) {
-            $this->dat['header']['extensionDependencies'] = array_filter($this->dat['header']['extensionDependencies']);
-        } else {
-            $this->dat['header']['extensionDependencies'] = array();
-        }
-    }
-
-    /**
      * Fix charset of import memory if different from system charset
      *
      * @return void
index 04cda0b..37ea164 100644 (file)
@@ -290,7 +290,7 @@ abstract class ImportExport
         }
         // Check extension dependencies:
         foreach ($this->dat['header']['extensionDependencies'] as $extKey) {
-            if (!ExtensionManagementUtility::isLoaded($extKey)) {
+            if (!empty($extKey) && !ExtensionManagementUtility::isLoaded($extKey)) {
                 $this->error('DEPENDENCY: The extension with key "' . $extKey . '" must be installed!');
             }
         }