Bug #81415

Section does not exist exception if extension layout file is named "Default"

Added by Daniel Corn over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2017-06-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
fluid, layout, section
Complexity:
Is Regression:
Sprint Focus:

Description

We are upgrading a TYPO3 v6 website to v8 LTS (with upgrading to 7 LTS first).

The website was built with `CSS styled content`, but with `FLUIDTEMPLATE` for the main page template rendering.
We still don't have `Fluid styled content` installed.

Problem: Exception 'Section "xyz" does not exist.'

Custom extension

The problem occurs in a custom extension

Some extension resources:

Resources/Private
                 - Layouts/Default.html
                 - Templates/Data/New.html

We get the exception with the following file contents:

Layout "Default.html":

<f:render section="xyz"/>

Template:

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default"/>

<f:section name="xyz">...</f:section>
</html>

The extension works if we rename the layout file

Layout "Foo.html":

<f:render section="xyz"/>

Template:

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Foo"/>

<f:section name="xyz">...</f:section>
</html>

Note: Changing the case of the layout file does not work

Rendering of the main template

We created a "master" extension that contains some common defaults for all our projects called "iresults_master".
And a the "client" extension that will contain project specific stuff.
The master extension is also responsible to configure the main template rendering:

# Create the page
page = PAGE
page.typeNum = 0

# Create FLUID Template
page.10 = FLUIDTEMPLATE
page.10 {
  # Assign the Template files with the Fluid Backend-Template
  templateName = TEXT
  templateName.stdWrap {
      wrap = |
      cObject = TEXT
      cObject {
          data = levelfield:-2,backend_layout_next_level,slide
          override.field = backend_layout
          split {
              token = pagets__
              1.current = 1
              1.wrap = |
          }
      }

      ifEmpty = 12-col
  }

  layoutRootPaths {
      10 = EXT:frontend/Resources/Private/Layouts
      20 = EXT:iresults_master/Resources/Private/Layouts
      30 = EXT:client/Resources/Private/Layouts
  }

  partialRootPaths {
      10 = EXT:frontend/Resources/Private/Partials
      20 = EXT:iresults_master/Resources/Private/Partials
      30 = EXT:client/Resources/Private/Partials
  }

  templateRootPaths {
      10 = EXT:frontend/Resources/Private/Templates
      20 = EXT:iresults_master/Resources/Private/Templates
      30 = EXT:client/Resources/Private/Templates/Page
  }
}

One of the page template files

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default"/>

<f:section name="content">...</f:section>
</html>

As you can see, the standard layout file for our pages is also called "Default"


Related issues

Related to TYPO3 Core - Bug #79760: FLUIDTEMPLATE not rendered when Layout name collides with Layout name of FSCClosed2017-02-11

Actions

Also available in: Atom PDF