Project

General

Profile

Actions

Bug #79760

closed

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

Added by Riccardo De Contardi about 7 years ago. Updated over 5 years ago.

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

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
On Location Sprint

Related issues 6 (0 open6 closed)

Related to TYPO3 Core - Bug #77235: Collision of page template partials having the same name as fluid_styled_content partialsClosed2016-07-24

Actions
Related to TYPO3 Core - Bug #81415: Section does not exist exception if extension layout file is named "Default"Closed2017-06-02

Actions
Related to TYPO3 Core - Bug #76675: Layout Filename must be unique or frontend crashesClosedmartin no-lastname-given2016-06-17

Actions
Related to TYPO3 Core - Bug #81021: Fatal error in fluid_template with switchableControllerActions, one plugin and a shared layout Closed2017-04-26

Actions
Related to TYPO3 Core - Bug #82338: Wrong Default.html layout file usedClosed2017-09-07

Actions
Related to TYPO3 Core - Bug #82889: fluid_styled_content major section bugClosed2017-10-31

Actions
Actions #1

Updated by Riccardo De Contardi about 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.

Actions #2

Updated by Riccardo De Contardi about 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

Actions #3

Updated by Armin Vieweg about 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?

Actions #4

Updated by Markus Klein about 7 years ago

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

Actions #5

Updated by Andre Koller about 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.

Actions #6

Updated by Markus Klein about 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
Actions #7

Updated by Patrick Broens about 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.

Actions #8

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

Updated by Patrick Broens about 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

Actions #10

Updated by Markus Klein about 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
Actions #11

Updated by Riccardo De Contardi about 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

Actions #12

Updated by Wolfgang Wagner almost 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.

Actions #13

Updated by taywa gmbh almost 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" />.

Actions #14

Updated by Michael Binder almost 7 years ago

yes, same here.

Renaming the file solved the Problem.

Actions #15

Updated by Daniel Corn almost 7 years ago

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

Updated by Jan Kiesewetter almost 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.

Actions #17

Updated by Florian Gaa almost 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.

Actions #18

Updated by Sven Teuber almost 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

Actions #19

Updated by Anonymous over 6 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!!

Actions #20

Updated by Daniel Corn over 6 years ago

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

Actions #21

Updated by Clemens Riccabona over 6 years ago

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

Updated by Clemens Riccabona over 6 years ago

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

Updated by Clemens Riccabona over 6 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/

Actions #24

Updated by Gerrit Code Review over 6 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

Actions #25

Updated by Bernhard Eckl over 6 years ago

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

Updated by Christian Wellinghorst over 6 years ago

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

Actions #27

Updated by Mona Muzaffar over 6 years ago

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

Updated by Benni Mack over 6 years ago

  • Sprint Focus changed from Stabilization Sprint to On Location Sprint
Actions #29

Updated by Benjamin Franzke over 6 years ago

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

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

Actions #31

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

Actions #32

Updated by Benjamin Franzke over 6 years ago

  • Status changed from Under Review to Resolved
Actions #33

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.

Actions #34

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/

Actions #35

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.

Actions #36

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF