Bug #81415
closedSection does not exist exception if extension layout file is named "Default"
100%
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"
Updated by Daniel Corn over 7 years ago
- Related to Bug #79760: FLUIDTEMPLATE not rendered when Layout name collides with Layout name of FSC added
Updated by Daniel Corn over 7 years ago
The extension also generates a PDF using mPDF. The HTML code that mPDF transforms is also built using Fluid. I'm fetching this code inside the controller action using $body = $this->view->render();
In this case, the problem does not occur. The rendering works fine even if the layout file is named "Default".
After the PDF file is generated it will be sent to the browser followed by a die
to terminate additional rendering.
Maybe some cache is mixing up something?
Updated by Riccardo De Contardi almost 7 years ago
- Status changed from New to Needs Feedback
#79760 has been merged. Could you test if this issue is solved, too? Thank you!
Updated by David Hämmerle almost 7 years ago
- % Done changed from 0 to 100
Riccardo De Contardi wrote:
#79760 has been merged. Could you test if this issue is solved, too? Thank you!
It's working for me!
After the Update to 8.7 i had some huge problems with my frontend(s), also got the error Message 'Section "main" does not exist.'. No problems anymore :)
Updated by Riccardo De Contardi almost 7 years ago
- Status changed from Needs Feedback to Closed
Thank you for your feedback!