diff --git a/Classes/Utility/FileUtility.php b/Classes/Utility/FileUtility.php index b7a9bdf0..09061bdc 100644 --- a/Classes/Utility/FileUtility.php +++ b/Classes/Utility/FileUtility.php @@ -19,7 +19,9 @@ use TYPO3\CMS\Core\Configuration\Features; use TYPO3\CMS\Core\Http\NormalizedParams; use TYPO3\CMS\Core\Imaging\ImageManipulation\CropVariantCollection; +use TYPO3\CMS\Core\Resource\File; use TYPO3\CMS\Core\Resource\FileInterface; +use TYPO3\CMS\Core\Resource\FileReference; use TYPO3\CMS\Core\Resource\ProcessedFile; use TYPO3\CMS\Core\Resource\Rendering\RendererRegistry; use TYPO3\CMS\Core\Utility\ArrayUtility; @@ -65,8 +67,8 @@ public function process(FileInterface $fileReference, ProcessingConfiguration $p { $originalFileReference = clone $fileReference; $originalFileUrl = $fileReference->getPublicUrl(); - $fileReferenceUid = $fileReference->getUid(); - $uidLocal = $fileReference->getProperty('uid_local'); + $fileReferenceUid = $fileReference instanceof FileReference ? $fileReference->getUid() : null; + $uidLocal = $fileReference instanceof File ? $fileReference->getUid() : $fileReference->getProperty('uid_local'); $fileRenderer = $this->rendererRegistry->getRenderer($fileReference); $crop = $fileReference->getProperty('crop'); $link = $fileReference->getProperty('link'); diff --git a/Tests/Unit/Utility/FileUtilityTest.php b/Tests/Unit/Utility/FileUtilityTest.php index f980c44a..e2ac645d 100644 --- a/Tests/Unit/Utility/FileUtilityTest.php +++ b/Tests/Unit/Utility/FileUtilityTest.php @@ -212,8 +212,8 @@ public function testCustomProcessingOptions(): void 'type' => 'image', 'filename' => 'test-file.jpg', 'originalUrl' => '/fileadmin/test-file.jpg', - 'uidLocal' => null, - 'fileReferenceUid' => 103, + 'uidLocal' => 103, + 'fileReferenceUid' => null, 'size' => '71 KB', 'dimensions' => [ @@ -672,8 +672,8 @@ protected function getBaselineResultArrayForFile(): array 'type' => 'image', 'filename' => 'test-file.jpg', 'originalUrl' => '/fileadmin/test-file.jpg', - 'uidLocal' => null, - 'fileReferenceUid' => 103, + 'uidLocal' => 103, + 'fileReferenceUid' => null, 'size' => '71 KB', 'dimensions' => [