diff --git a/typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php b/typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php index 09e3f7a..7fa3d8c 100644 --- a/typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php +++ b/typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php @@ -334,7 +334,7 @@ class FileIndexRepository implements SingletonInterface return $this->getDatabaseConnection()->exec_SELECTgetRows( implode(',', $this->fields), $this->table, - 'tstamp > last_indexed AND storage = ' . (int)$storage->getUid(), + 'tstamp > last_indexed AND storage = ' . (int)$storage->getUid() . ' AND missing = 0', '', 'tstamp ASC', (int)$limit > 0 ? (int)$limit : '' diff --git a/typo3/sysext/core/Classes/Resource/Index/Indexer.php b/typo3/sysext/core/Classes/Resource/Index/Indexer.php index 2913657..8123464 100644 --- a/typo3/sysext/core/Classes/Resource/Index/Indexer.php +++ b/typo3/sysext/core/Classes/Resource/Index/Indexer.php @@ -106,8 +106,13 @@ class Indexer { $fileIndexRecords = $this->getFileIndexRepository()->findInStorageWithIndexOutstanding($this->storage, $maximumFileCount); foreach ($fileIndexRecords as $indexRecord) { - $fileObject = $this->getResourceFactory()->getFileObject($indexRecord['uid'], $indexRecord); - $this->extractMetaData($fileObject); + try { + $fileObject = $this->getResourceFactory()->getFileObject($indexRecord['uid'], $indexRecord); + $this->extractMetaData($fileObject); + } catch (\TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException $e) { + // mark file as missing, continue with next record + $this->getFileIndexRepository()->markFileAsMissing($indexRecord['uid']); + } } }