Bug #79760

FLUIDTEMPLATE not rendered when Layout name collides with Layout name of FSC

Added by Riccardo De Contardi 10 months ago. Updated 21 days ago.

Status:
Under Review
Priority:
Must have
Assignee:
-
Category:
Fluid Styled Content
Target version:
-
Start date:
2017-02-11
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

Related issues

Related to TYPO3 Core - Bug #77235: Collision of page template partials having the same name as fluid_styled_content partials New 2016-07-24
Related to TYPO3 Core - Bug #81415: Section does not exist exception if extension layout file is named "Default" New 2017-06-02
Related to TYPO3 Core - Bug #76675: Layout Filename must be unique or frontend crashes Closed 2016-06-17
Related to TYPO3 Core - Bug #81021: Fatal error in fluid_template with switchableControllerActions, one plugin and a shared layout New 2017-04-26
Related to TYPO3 Core - Bug #82338: Wrong Default.html layout file used Needs Feedback 2017-09-07
Related to TYPO3 Core - Bug #82889: fluid_styled_content major section bug New 2017-10-31

History

#1 Updated by Riccardo De Contardi 10 months 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.

#2 Updated by Riccardo De Contardi 10 months 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

#3 Updated by Armin Vieweg 9 months 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?

#4 Updated by Markus Klein 9 months ago

@Armin: Your are running into https://forge.typo3.org/issues/80044

#5 Updated by Andre Koller 9 months ago

I got also no output.

After applying this Patch https://forge.typo3.org/issues/80044

and renaming layout name "Default" it works.

#6 Updated by Markus Klein 9 months 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

#7 Updated by Patrick Broens 9 months 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.

#8 Updated by Patrick Broens 9 months 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>

#9 Updated by Patrick Broens 9 months 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

#10 Updated by Markus Klein 9 months ago

  • Status changed from Accepted to Needs Feedback
  • Assignee deleted (Benni Mack)
  • Target version deleted (8 LTS)
  • Is Regression changed from Yes to No

#11 Updated by Riccardo De Contardi 9 months 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

#12 Updated by Wolfgang Wagner 7 months 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.

#13 Updated by taywa gmbh 7 months 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" />.

#14 Updated by Michael Binder 6 months ago

yes, same here.

Renaming the file solved the Problem.

#15 Updated by Daniel Corn 6 months ago

  • Related to Bug #81415: Section does not exist exception if extension layout file is named "Default" added

#16 Updated by Jan Kiesewetter 6 months 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.

#17 Updated by Florian Gaa 5 months 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.

#18 Updated by Sven Teuber 5 months 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

#19 Updated by Tobias Gaertner 3 months 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!!

#20 Updated by Daniel Corn 3 months ago

Dear TYPO3 Core team! Can you give us a bit of an insight if somebody is working on this issue?

#21 Updated by Clemens Riccabona 3 months ago

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

#22 Updated by Clemens Riccabona 3 months ago

  • Related to Bug #81021: Fatal error in fluid_template with switchableControllerActions, one plugin and a shared layout added

#23 Updated by Clemens Riccabona 3 months 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/

#24 Updated by Gerrit Code Review about 1 month 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

#25 Updated by Bernhard Eckl 23 days ago

  • Related to Bug #82338: Wrong Default.html layout file used added

#26 Updated by Christian Wellinghorst 21 days ago

Patch works in my situation (https://forge.typo3.org/issues/82889), which should be the same problem as described here.

#27 Updated by Mona Muzaffar 16 days ago

  • Related to Bug #82889: fluid_styled_content major section bug added

Also available in: Atom PDF