Project

General

Profile

Actions

Bug #75315

closed

Wrong inline array notation in ContainerViewHelper docs

Added by Thomas Noest about 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2016-03-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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!

Actions

Also available in: Atom PDF