Skip to content
Snippets Groups Projects
Commit d250d1f6 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Fetch original file from file reference in ThumbnailViewHelper

Using `treatIdAsReference` it's also possible to
pass a file reference uid to the ThumbnailViewHelper.

To allow processing such reference, the original
file is now fetched to call `process` on it.

Resolves: #102571
Releases: main, 12.4
Change-Id: If2f9cad99045d19c6dcc4b95bba6b7de71405956
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82375


Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
parent 8c40ce02
No related merge requests found
......@@ -200,11 +200,6 @@ parameters:
count: 1
path: ../../typo3/sysext/backend/Classes/View/BackendLayout/ContentFetcher.php
-
message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Resource\\\\FileInterface\\:\\:process\\(\\)\\.$#"
count: 1
path: ../../typo3/sysext/backend/Classes/ViewHelpers/ThumbnailViewHelper.php
-
message: "#^Parameter \\#2 \\$attributeValue of method TYPO3Fluid\\\\Fluid\\\\Core\\\\ViewHelper\\\\TagBuilder\\:\\:addAttribute\\(\\) expects array\\|string\\|Traversable\\|null, TYPO3\\\\CMS\\\\Core\\\\Imaging\\\\ImageManipulation\\\\Area given\\.$#"
count: 1
......
......@@ -133,6 +133,11 @@ final class ThumbnailViewHelper extends AbstractTagBasedViewHelper
}
}
if (is_callable([$image, 'getOriginalFile'])) {
// Get the original file from the file reference
$image = $image->getOriginalFile();
}
$processedFile = $image->process($this->arguments['context'], $processingInstructions);
$imageUri = $processedFile->getPublicUrl();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment