Bug #82745

fluid resolving an unexpected layout file

Added by Peter Niederlag 2 months ago. Updated 17 days ago.

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

100%

TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

We run into an Exception during rendering an Extension:

Uncaught TYPO3 Exception
Section "main" does not exist.

Actually something is going wrong during resolving the proper layout file.

Page Template

page.10 = FLUIDTEMPLATE
does use a layout "Default", with a section "content" (but no section "main")

layoutRootPaths is set properly in TS.

This is working just fine on almost all pages.

Plugin Template

plugin.tx_xxx does use a layout "Default" as well, however here we use a section "main" (but no section "content").
layoutRootPaths,and alike are set properly in TS.

However during rendering this extension for some weird(and yet unknown) reason the layout file from the page is used (which obviously is missing the section "main".

During debugging I found AbstractTemplateView of typo3fluid ll 190 through 200 responsible. $paths->getLayoutSource($layoutName) does return the proper source at first but however at some later point a wrong file will be served from cache.

The most weird thing, we use Layout Default for other extensions as well where we don't have this problem.

Templates and Layouts are all stored in a site-package (EXT:xxx-site)


Related issues

Related to TYPO3 Core - Bug #76675: Layout Filename must be unique or frontend crashes Closed 2016-06-17

Associated revisions

Revision 5c048a4c (diff)
Added by Benjamin Franzke 17 days ago

[BUGFIX] Fix recursive FLUIDTEMPLATE cObj's that use layoutRootPaths

FLUIDTEMPLATE variables may contain content elements (e.g. recursive
FLUIDTEMPLATE's) which may instantiate own TemplateViews
(e.g. StandaloneView).
A recursive StandaloneView will statically(!!) cache used TemplatesPaths
in \TYPO3Fluid\Fluid\View\Templates::resolvedFiles.

If StandaloneView is instantiated before, but the fluid layout path is
calculated after inner content objects are being rendering,
the altered statically cached `resolvedFiles` cache is used
and contains invalid layoutRootPaths.

Short term solution:
Defer the initialization of the StandaloneView (which flushes those
buggy caches) until all variables have been processed.

Change-Id: Idf053b3d0f0835a352790e0ed971344d67844bbc
Releases: master, 8.7
Resolves: #79760
Resolves: #82745
Reviewed-on: https://review.typo3.org/54416
Tested-by: TYPO3com <>
Reviewed-by: Sebastian Hofer <>
Tested-by: Sebastian Hofer <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>

History

#1 Updated by Peter Niederlag 2 months ago

  • Related to Bug #76675: Layout Filename must be unique or frontend crashes added

#2 Updated by Susanne Moog about 2 months ago

  • Category set to Fluid

#3 Updated by Gerrit Code Review about 2 months ago

  • Status changed from New to Under Review

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

#4 Updated by Benjamin Franzke 17 days ago

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

Also available in: Atom PDF