#104559Enlarge on Click [image_zoom] with ".gif" files results in FileReference could not be converted to string
Description
Enlarge on Click [image_zoom] with “.gif” files results in FileReference could not be converted to string.
For example use TextMedia contentelement add a “.gif” file and set Enlarge on Click – so that the “ce:link.clickEnlarge” ViewHelper is used (fluid_styled_content/Resources/Private/Partials/Media/Type/Image.html).
Then at the Frontend the Error occures:
“Object of class TYPO3\CMS\Core\Resource\FileReference could not be converted to string.“
Only on GIF files – svg, jpg, jpeg, mp4, png works fine.
The TYPO3\CMS\Frontend\Typolink\LinkFactory->create() Method is called two times, one time empty “$linkConfiguration” and one time with values (array), see screenshoots.
Reviews 2
Related issues 1
Files 5
History 67
-
Garvin Hicking changed category <span data-processor="relativetime" data-value="2024-08-06T17:08:28+00:00" > 08/06/24, 17:08 </span>
-
Georg Ringer commented and changed attached Bildschirmfoto 2025-01-31 um 12.48.08.png status
NewNeeds Feedback <span data-processor="relativetime" data-value="2025-01-31T11:48:58+00:00" > 01/31/25, 11:48 </span> -
Sascha Löffler commented and changed attached enlargeOnClickCorePatch.patch <span data-processor="relativetime" data-value="2025-03-13T13:49:29+00:00" > 03/13/25, 13:49 </span>
Got the same error, but with jpeg images on TYPO3 v13.
It seems it happens because the url in the ContentObjectRenderer is overwritten with the initial FileReference at this location:$directImageLink = $this->stdWrapValue('directImageLink', $conf ?? []); if ($directImageLink) { $imgResourceConf = [ 'file' => $imageFile, 'file.' => $conf, ]; $url = $this->cObjGetSingle('IMG_RESOURCE', $imgResourceConf); if (!$url) { // If no imagemagick / gm is available $url = $imageFile; } }Then with disabled JSwindow, it sets $conf[‘linkParams.’][‘parameter’] to $url
At this point we have the FileReference at a place where it normally expects an ID since in the LinkFactory we got
$linkParameter = trim((string)($linkConfiguration['parameter'] ?? ''));I attached a patch which seems to work (for TYPO3 v13).
-
Gerrit Code Review pushed patch set 1 for main to change 88847 status
Needs FeedbackUnder Review <span data-processor="relativetime" data-value="2025-03-31T12:16:10+00:00" > 03/31/25, 12:16 </span> -
Benni Mack changed Related to #93345 <span data-processor="relativetime" data-value="2025-04-11T17:16:40+00:00" > 04/11/25, 17:16 </span>
-
Benni Mack commented <span data-processor="relativetime" data-value="2025-04-11T17:17:01+00:00" > 04/11/25, 17:17 </span>
Can you check if this change solves your problem?
-
Georg Ringer commented and changed status
Under ReviewClosed <span data-processor="relativetime" data-value="2026-02-07T09:40:39+00:00" > 02/07/26, 09:40 </span>couldn’t reproduce that in v13 and also lack of feedback, closing issue.
feel free to contact me on slack if still valid
tested that in a blank 12 & 13 installation and didn’t have any issues
see screenshot
Bildschirmfoto%202025-01-31%20um%2012.48.08.png
can you please retest on a blank latest installation?