Actions
Feature #87833
openDetect missing file for a given FileReference in Extbase
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.
Updated by Jan Kornblum over 4 years ago
- Tracker changed from Bug to Feature
Changed this from "bug" to possible "feature" as the current behaviour is explained here: https://stackoverflow.com/questions/54983438/typo3-extbase-detect-missing-files-for-a-given-filereference. Otherwise this issue might be closed, of course.
Actions