Bug #79760
closedFLUIDTEMPLATE not rendered when Layout name collides with Layout name of FSC
Added by Riccardo De Contardi over 7 years ago. Updated almost 6 years ago.
100%
Updated by Riccardo De Contardi over 7 years ago
These steps should be sufficient to reproduce on the latest master:
1) Enable and load FSC
2) TS Setup:
page=PAGE page.10 = FLUIDTEMPLATE page.10 { templateName = Default layoutRootPaths { 10 = fileadmin/Layouts } partialRootPaths { 10 = fileadmin/Partials } templateRootPaths { 10 = fileadmin/Templates } }
3) put a Default.html inside /fileadmin/Templates/ with the following content:
<f:layout name="Default" /> <f:section name="content"> <h1>hello world</h1> </f:section>
4) put a file Default.html inside /fileadmin/Layouts/ with the following content
<f:render section="content" />
5) Result: the page.10 object is ignored and instead you get inside the page:
<div id="c1" class="frame frame- frame-type- frame-layout-1"></div>
where the "c1" has the page ID
If you change the layout name (e.g. "Index.html") and the related <f:layout name="Index" />
everything works again.
Updated by Riccardo De Contardi over 7 years ago
UPDATE
1) to reproduce the issue, you must have a configuration like this one:
page.10 = FLUIDTEMPLATE page.10 { templateName = Default layoutRootPaths { 10 = fileadmin/Layouts } partialRootPaths { 10 = fileadmin/Partials } templateRootPaths { 10 = fileadmin/Templates } variables { maincontent < styles.content.get } }
2) If you use a subfolder as repository for the Layouts, e.g.
partialRootPaths { 10 = fileadmin/Layouts/Page
the issue is still present
3) The Default.html of FSC is taken instead of that inside fileadmin/Layouts/Page: if you modify the template:
<f:layout name="Default" /> <f:section name="Main"> <h1>hello world</h1> </f:section>
you are able to see the content, but you are using the Default.html layout file of FSC: you can even still keep the layout with the wrong section name:
<f:render section="content" />
4) the responsible of the issue is the variable maincontent < styles.content.get
If you remove that line, and use instead:
lib.content = < styles.content.get
in combination with <f:cObject typoscriptObjectPath="lib.content" />
, everything works fine
Updated by Armin Vieweg over 7 years ago
I'm using this configuration:
lib.templates.base.file.stdWrap.cObject = CASE lib.templates.base.file.stdWrap.cObject { key.field = backend_layout key.ifEmpty.data = levelfield : -1 , backend_layout_next_level, slide default = TEXT default.value = EXT:project/Templates/BackendLayouts/Default.html pagets__Home = TEXT pagets__Home.value = EXT:project/Templates/BackendLayouts/Home.html }
And currently (8.6) I get no output in styles.content.get when fluid_styled_content is included to template. CSS Styled Content works.
Most likely related to this topic?
Updated by Markus Klein over 7 years ago
@Armin: Your are running into https://forge.typo3.org/issues/80044
Updated by Andre Koller over 7 years ago
I got also no output.
After applying this Patch https://forge.typo3.org/issues/80044
and renaming layout name "Default" it works.
Updated by Markus Klein over 7 years ago
- Status changed from New to Accepted
- Target version set to 8 LTS
- Is Regression changed from No to Yes
- Sprint Focus set to Stabilization Sprint
Updated by Patrick Broens over 7 years ago
Are you sure this is against latest master?
I don't get it that the FLUIDTEMPLATE
declared in page.10
is inheriting stuff from FSC.
Updated by Patrick Broens over 7 years ago
I've just tried to reproduce this. New installation on master, with only the TS as mentioned and the template and layout file. FSC installed.
Cannot reproduce this. Body content is as expected.
<h1>hello world</h1>
Updated by Patrick Broens over 7 years ago
Looking at your first TS setup, there is an error
page=PAGE page.10 = FLUIDTEMPLATE lib.stdcontent { templateName = Default layoutRootPaths { 10 = fileadmin/Layouts } partialRootPaths { 10 = fileadmin/Partials } templateRootPaths { 10 = fileadmin/Templates } }
lib.stdcontent
should be page.10
. But with that error I can't explain why something is rendering at all
Updated by Markus Klein over 7 years ago
- Status changed from Accepted to Needs Feedback
- Assignee deleted (
Benni Mack) - Target version deleted (
8 LTS) - Is Regression changed from Yes to No
Updated by Riccardo De Contardi over 7 years ago
- Status changed from Needs Feedback to Accepted
Yes, you are right, I did a wrong cut and paste. The original lines were:
lib.stdcontent = FLUIDTEMPLATE ... page.10 < lib.stdcontent
I have updated the issue comment n° 1
Updated by Wolfgang Wagner over 7 years ago
Exact the same problem still in 8.7.1 with this code:
page.10 = FLUIDTEMPLATE page.10 { layoutRootPath = EXT:myext/Resources/Private/Layouts/ partialRootPath = EXT:myext/Resources/Private/Partials/ file = EXT:myext/Resources/Private/Templates/Default.html
I had a layout file in Resources/Private/Layouts/Default.html
Renaming it to Standard.html (or something else) solved it.
Updated by taywa gmbh over 7 years ago
Same here, took me hours!
I think this is a common problem upgrading from 7 LTS, because examples on the web using <f:layout name="Default" />.
Updated by Michael Binder about 7 years ago
yes, same here.
Renaming the file solved the Problem.
Updated by Daniel Corn about 7 years ago
- Related to Bug #81415: Section does not exist exception if extension layout file is named "Default" added
Updated by Jan Kiesewetter about 7 years ago
I can confirm this problem.
I think this is a caching issue.
Just one Fluid layout from StandaloneView per filename is cached as a php file to typo3temp/var/Cache/Code/fluid_template/layout_Default_xxx.php
This cached layout is used for every FLUIDTEMPLATE / StandaloneView.
Updated by Florian Gaa about 7 years ago
This Issue is also affecting partials in my case. Naming a partial for example ../Partials/Header/Header.html (same as fsc names it) results in no output of the selfmade partial.
Updated by Sven Teuber about 7 years ago
I can confirm the issue and the "fix" of renaming own Layout files to something other than Default.html on TYPO3 8.7.1 & 8.7.2
Updated by Anonymous almost 7 years ago
Same here TYPO3 8.7.4
Renaming Layout "Default" to "Main" solved it.
PROBLEM is even the ExtensionBuilder creates Layout called "Default"...and I think I followed this "convention" in all projects...and all of us do ;-)
Since it will appear also with other names like naming a partial "Header" will cause the same problem - this should be fixed!!
Updated by Daniel Corn almost 7 years ago
Dear TYPO3 Core team! Can you give us a bit of an insight if somebody is working on this issue?
Updated by Clemens Riccabona almost 7 years ago
- Related to Bug #76675: Layout Filename must be unique or frontend crashes added
Updated by Clemens Riccabona almost 7 years ago
- Related to Bug #81021: Fatal error in fluid_template with switchableControllerActions, one plugin and a shared layout added
Updated by Clemens Riccabona almost 7 years ago
It seems, there are a couple of related bug-reports, some with the 'magic words' Template-name Default.html. I also found people having troubles on german-speaking forums.
e.g. https://webdesign-forum.net/thread-4176-post-18883.html
and https://www.typo3.net/forum/thematik/zeige/kategorie/linux-unix/thema/126195/
Updated by Gerrit Code Review almost 7 years ago
- Status changed from Accepted 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
Updated by Bernhard Eckl almost 7 years ago
- Related to Bug #82338: Wrong Default.html layout file used added
Updated by Christian Wellinghorst almost 7 years ago
Patch works in my situation (https://forge.typo3.org/issues/82889), which should be the same problem as described here.
Updated by Mona Muzaffar almost 7 years ago
- Related to Bug #82889: fluid_styled_content major section bug added
Updated by Benni Mack over 6 years ago
- Sprint Focus changed from Stabilization Sprint to On Location Sprint
Updated by Benjamin Franzke over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 5c048a4c8017e4d50ab5f2343970a0fd33e4aaed.
Updated by Gerrit Code Review over 6 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55252
Updated by Gerrit Code Review over 6 years ago
Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55252
Updated by Benjamin Franzke over 6 years ago
- Status changed from Under Review to Resolved
Applied in changeset dbf5f643b5fe9574eb204708b9dc77b404a26f68.
Updated by Kurt Gusbeth over 6 years ago
- PHP Version changed from 7.0 to 7.1
This bug is not fixed yet. I am getting this error with TYPO3 8.7.9:
Fatal error: Cannot declare class layout_default_7c967e45e97a37c67a007855084550c92e894ba4, because the name is already in use in /xxx/typo3temp/var/Cache/Code/fluid_template/layout_default_7c967e45e97a37c67a007855084550c92e894ba4.php on line 0
Renaming the layout file from default.html to Somethingelse.html solves the problem for me. Now I get this error:
#1225709595: The Fluid template files "/xxx/fileadmin/bsdist/theme/tmpl/backend_layout/Partials/Header.html", "/xxx/fileadmin/bsdist/theme/tmpl/backend_layout/Partials/Header" could not be loaded.
There were no problems with TYPO3 7 LTS.
Updated by Jacob Rasmussen over 6 years ago
TYPO3 8.7.9 was released in December, whereas this bug was fixed a week ago, so if you want to test whether or not the issue have been fixed, you need to fetch the TYPO3 8-7 branch from git or wait until the next patch release - which according to the roadmap should be released on the 6th of february.
https://typo3.org/news/article/typo3-release-improvements-v8-maintenance-release-schedule/
Updated by Kurt Gusbeth over 6 years ago
OK, the patch worked for me.
And renaming the partial header.html to Header.html worked for me too.
Updated by Benni Mack almost 6 years ago
- Status changed from Resolved to Closed