Bug #75315
closedWrong inline array notation in ContainerViewHelper docs
100%
Description
I got this in f:be.container with includeCssFiles= and includeJsFiles= (notation found on https://fluidtypo3.org/viewhelpers/fluid/master/Be/ContainerViewHelper.html @all review Options)
"0: '{f:uri.resource(path:\'Css/Styles.css\')}'" gets outputted as string in the response. Debugging this I found that it gets labeled as a TextNode in Classes/Core/Parser/TemplateParser.php in function textAndShorthandSyntaxHandler(). I got it working with this patch:
} elseif ($context === self::CONTEXT_INSIDE_VIEWHELPER_ARGUMENTS && preg_match(self::$SCAN_PATTERN_SHORTHANDSYNTAX_ARRAYS, $section, $matchedVariables) > 0) {
// We only match arrays if we are INSIDE viewhelper arguments
$this->arrayHandler($state, $matchedVariables['Array']);
}
// Thomas Patch
elseif ($context === self::CONTEXT_INSIDE_VIEWHELPER_ARGUMENTS && preg_match(self::$SPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS, $section, $matchedVariables) > 0) {
// We only match arrays if we are INSIDE viewhelper arguments
$this->arrayHandler($state, $matchedVariables['ArrayPart']);
}
// END Thomas Patch END
else {
$this->textHandler($state, $section);
}
This works, but I am new to this and have not much more in my templates. As far as I can see, this is not constraint to be.container, so it could squat more bugs. But that, and if my patch is the right direction, is for a more knowledgeable person to decide!