[BUGFIX] Fix call to undefined function when importing t3x 32/32332/2
authorRené Bigler <raziel@dunkelweiss.li>
Wed, 23 Jul 2014 22:06:38 +0000 (00:06 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Sat, 23 Aug 2014 14:50:21 +0000 (16:50 +0200)
When importing a t3x file that contains files the function
"getFiles" of the object TYPO3\CMS\Core\Resource\Folder is called
which does not exist.

Resolves: #60474
Releases: 6.3, 6.2
Change-Id: Ibc392bced57a85ad6eae333406ff507af7faefd4
Reviewed-on: http://review.typo3.org/32332
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/impexp/Classes/ImportExport.php

index 16951de..b2e44df 100644 (file)
@@ -2085,7 +2085,8 @@ class ImportExport {
         ***************************/
 
        /**
-        * At the end of the import process all file and DB relations should be set properly (that is relations to imported records are all re-created so imported records are correctly related again)
+        * At the end of the import process all file and DB relations should be set properly (that is relations
+        * to imported records are all re-created so imported records are correctly related again)
         * Relations in flexform fields are processed in setFlexFormRelations() after this function
         *
         * @return void
@@ -2143,7 +2144,8 @@ class ImportExport {
                                                                                        try {
                                                                                                // check, if there is alreay the same file in the folder
                                                                                                if ($this->legacyImportFolder->hasFile($fileName)) {
-                                                                                                       $file = $this->legacyImportFolder->getFile($fileName);
+                                                                                                       $fileStorage = $this->legacyImportFolder->getStorage();
+                                                                                                       $file = $fileStorage->getFile($this->legacyImportFolder->getIdentifier() . $fileName);
                                                                                                        if ($file->getSha1() === sha1_file($tempFile)) {
                                                                                                                $fileObject = $file;
                                                                                                        }
@@ -2799,7 +2801,8 @@ class ImportExport {
                try {
                        // check, if there is alreay the same file in the folder
                        if ($importFolder->hasFile($fileName)) {
-                               $file = $importFolder->getFile($fileName);
+                               $fileStorage = $importFolder->getStorage();
+                               $file = $fileStorage->getFile($importFolder->getIdentifier() . $fileName);
                                if ($file->getSha1() === sha1_file($temporaryFile)) {
                                        $fileObject = $file;
                                }