[BUGFIX] FileStorageExtractionTask breaks if file not found 69/51969/7
authorThomas Hohn <thomas@hohn.dk>
Tue, 7 Mar 2017 07:19:46 +0000 (08:19 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 15 Nov 2017 10:32:41 +0000 (11:32 +0100)
Before the file is processed a extra check is done to be sure the file
exists. If the file doesn't exist it's marked as missing.

Resolves: #80061
Releases: master, 8.7
Change-Id: Ifda396b75d2ace0ce126057a4e118856b15c05e0
Reviewed-on: https://review.typo3.org/51969
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Resource/Index/Indexer.php

index 7b631f5..2813fdd 100644 (file)
@@ -106,7 +106,14 @@ class Indexer
         $fileIndexRecords = $this->getFileIndexRepository()->findInStorageWithIndexOutstanding($this->storage, $maximumFileCount);
         foreach ($fileIndexRecords as $indexRecord) {
             $fileObject = $this->getResourceFactory()->getFileObject($indexRecord['uid'], $indexRecord);
-            $this->extractMetaData($fileObject);
+            // Check for existence of file before extraction
+            if ($fileObject->exists()) {
+                $this->extractMetaData($fileObject);
+
+                // Mark file as missing and continue with next record
+            } else {
+                $this->getFileIndexRepository()->markFileAsMissing($indexRecord['uid']);
+            }
         }
     }