Bug #77945
openresponsive IMAGE rendering does not work if inside FILES
0%
Description
OptionSplit for config key layout.$layoutKey.source of an IMAGE does not work if the IMAGE is a renderObj of a FILES content element.
The FILES content object resolves all optionSplit strings for the file count.
Therefor, when the IMAGE content object wants to split the layout.$layoutKey for the count of sourceCollection items the optionSplit strings are already resolved but for the wrang thing.
This bug breaks the key feature for responsive image rendering (https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Image/Index.html#cobj-image-layoutkey).
FILES rendering:
$splitConf = $GLOBALS['TSFE']->tmpl->splitConfArray($conf, $availableFileObjectCount);
in
sysext/frontend/Classes/ContentObject/FilesContentObject.php :: render(), Line: 43
IMAGE rendering:
$srcLayoutOptionSplitted = $tsfe->tmpl->splitConfArray($conf['layout.'][$layoutKey . '.'], count($activeSourceCollections));
in
sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php :: getImageSourceCollection() , Line:1678
TS Example that takes the first image from the page media column:
lib.headerImage = FILES lib.headerImage { references { data = levelmedia:-1, slide } begin = 0 maxItems = 1 renderObj = IMAGE renderObj { file { treatIdAsReference = 1 import.data = file:current:uid width = 320c height = 133c } sourceCollection { x320 { width = 320c height = 133c srcsetCandidate = 320w } x640 { width = 640c height = 267c srcsetCandidate = 640w } x1242 { width = 1242c height = 517c srcsetCandidate = 1242w } } layoutKey = srcset layout { srcset { element = <img src="###SRC###" srcset="###SOURCECOLLECTION###" sizes="100vw" ###PARAMS### ###ALTPARAMS### ###SELFCLOSINGTAGSLASH###> # the optionSplits in the next line gets resolved by the FILES renderer and not the IMAGE renderer => missing "," for the last img tag, and and wrong "," at the end for all other img tags source = |*|###SRC### ###SRCSETCANDIDATE###,|*|###SRC### ###SRCSETCANDIDATE### } } altText.data = file:current:alternative titleText.data = file:current:title } }
Result of this example is a image element with missing "," inside the srcset attribute.