Bug #78326

Fatal error: Call to a member function getViewHelper() on a non-object in template cache file

Added by Bill Dagou over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2016-10-18
Due date:
% Done:

100%

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

Description

When using nested fluid in <f:layout> in a fluid template, like

<f:layout name="{f:cObject(typoscriptObjectPath: 'lib.layout')}" />

the cache file would get fatal error when parsing the layout name in line 178 in \TYPO3\CMS\Fluid\View\AbstractTemplateView::render(), because $self is not defined in the cache file.

After a few research, adding

\$self = \$this;

before line 98 in \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler would get the error fixed, and the nexted fluid would be rendered correctly.

Associated revisions

Revision 2a688436 (diff)
Added by Claus Due over 1 year ago

[BUGFIX] Add back-reference to $self in compiled Fluid templates

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 <>
Reviewed-by: Bill Dagou <>
Tested-by: Bill Dagou <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Claus Due over 1 year ago

Only an issue on 7.6, resolved on 8.0+.

#2 Updated by Bill Dagou over 1 year ago

Ya, I'm using v7.6.11 right now.

If so, can it be fixed in v7.6? I mean an easy fix.

#3 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50288

#4 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50289

#5 Updated by Anonymous over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF