[BUGFIX] Add back-reference to $self in compiled Fluid templates 89/50289/2
authorClaus Due <claus@namelesscoder.net>
Thu, 20 Oct 2016 10:07:30 +0000 (12:07 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 21 Oct 2016 11:53:51 +0000 (13:53 +0200)
This fixes a bug where using any ViewHelper to generate
the layout name would fail if the template is compilable.
The problem is long ago fixed in Fluid Standalone as part
of the decoupling.

Simply assigning the `self` reference solves the problem.

Change-Id: I9b980d6647d9961215b49d5dc85829f15dcd8de7
Resolves: #78326
Releases: 7.6
Reviewed-on: https://review.typo3.org/50289
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Bill Dagou <billdagou@gmail.com>
Tested-by: Bill Dagou <billdagou@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/fluid/Classes/Core/Compiler/TemplateCompiler.php

index 07252f9..b51d684 100644 (file)
@@ -96,6 +96,7 @@ public function getVariableContainer() {
 }
 public function getLayoutName(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface \$renderingContext) {
 \$currentVariableContainer = \$renderingContext->getTemplateVariableContainer();
+\$self = \$this;
 %s
 return %s;
 }