Open DanYouCan opened 2 weeks ago
Untested, but if this worked in earlier versions then it's possible that the object was automatically converted from File(Reference) to string, in which case it might work for you if you use src="{file as string}"
(fluid's type casting mechanism).
It is correct that this ViewHelper does not support File(Reference) instances and never did (except possibly by coincidence). Recent changes have made this constraint a formal constraint by using strict type hints for arguments where before, it's possible the methods may have silently accepted a File(Reference) instance and simply converted it to a string internally.
I have upgraded TYPO3 from version 9 (vhs V6.1.3) to 12 vhs V7.0.3. With V12 I got the following error:
FluidTYPO3\Vhs\ViewHelpers\Media\ImageViewHelper::getImgResource(): Argument #1 ($src) must be of type string, TYPO3\CMS\Core\Resource\FileReference given, called in /html/typo3-upgr/typo3conf/ext/vhs/Classes/Traits/SourceSetViewHelperTrait.php on line 48
For that my frontend fluid code was (it was taken over from V9):
After debugging and trial I ended up with following working code:
So it looks like this view helper in vhs V7.0.3 can no longer handle objects like {file}? Is this intentional? Thank you in advance for checking my statement.