Project

General

Profile

Actions

Bug #95102

closed

Uncaught TYPO3 Exception: Call to undefined method TYPO3\CMS\Core\Resource\ProcessedFile::setMissing()

Added by Robert von Hackwitz about 3 years ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Start date:
2021-09-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Sometimes when a file preview doesn't exists in fileadmin storage an Exception is caught

request="4261316b5bf85" component="TYPO3.CMS.Core.Error.ProductionExceptionHandler": Core: Exception handler (WEB): Uncaught TYPO3 Exception: Call to undefined method TYPO3\CMS\Core\Resource\ProcessedFile::setMissing() | Error thrown in file MYSERVERPATH/typo3_src-10.4.20/typo3/sysext/core/Classes/Resource/ResourceStorage.php

/**
     * Gets a file by identifier.
     *
     * @param string $identifier
     * @return FileInterface
     */
    public function getFile($identifier)
    {
        $file = $this->getFileFactory()->getFileObjectByStorageAndIdentifier($this->getUid(), $identifier);
        if (!$this->driver->fileExists($identifier)) {
            $file->setMissing(true);
        }
        return $file;
    }

Actions

Also available in: Atom PDF