Project

General

Profile

Actions

Feature #87833

open

Detect missing file for a given FileReference in Extbase

Added by Jan Kornblum over 5 years ago. Updated over 4 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2019-03-04
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.2
Tags:
Complexity:
Sprint Focus:

Description

I've tried three different ways to detect if a `FileReference`'s original file is still existing (i.e. file has been deleted outside TYPO3 using SFTP or similar):

if($fileReference instanceof \TYPO3\CMS\Extbase\Domain\Model\FileReference) {
    $isMissing = $fileReference->getOriginalResource()->getStorage()->getFile($fileReference->getOriginalResource()->getIdentifier())->isMissing();
    $isMissing = $fileReference->getOriginalResource()->getOriginalFile()->isMissing();
    $isMissing = $fileReference->getOriginalResource()->isMissing();
}

Only the first one gives me the right `isMissing()` value. In addition, there is no possibility in FLUID to check against missing files for a fiven relation. You have to write an own viewhelper using the code above for this.

Actions

Also available in: Atom PDF