[BUGFIX] Fix call to undefined function when importing t3x 44/31744/6
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:49:55 +0000 (16:49 +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/31744
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/impexp/Classes/ImportExport.php

index 35efc57..9b95ab7 100644 (file)
@@ -2171,7 +2171,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
@@ -2229,7 +2230,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;
                                                                                                        }
@@ -2895,7 +2897,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;
                                }