Bug #81021

Fatal error in fluid_template with switchableControllerActions, one plugin and a shared layout

Added by Dominik Hahn over 4 years ago. Updated about 4 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


Hello guys,

I am porting and old extension to 8.7.1 and came across this problem:

A very simple extension: One controller, two actions.
Both actions have their own fluid template, both share the layout "Resources/Private/Layouts/Default.html"

One registered plugin called "Main" and switchableControllerActions in a Flexform to make both actions selectable for the editors.

Everything is fine when I use the plugin on a single page only once.

As soon as I add the plugin a second time (with another action or even the same action selected) I get the following error on the page in the frontend:

Fatal error: Cannot declare class layout_default_ca646fe3088961927af32c308d5f12419c385887, because the name is already in use in /srv/www/public/sites/customer01/web/typo3temp/var/Cache/Code/fluid_template/layout_default_ca646fe3088961927af32c308d5f12419c385887.php on line 0

The error is gone upon first reload after clearing the cache and it comes back with the second reload.

So far I can only "fix" it by disabling the second plugin or by duplicating the layout file and setting the layout of the second action to the new layout file so that the actions don't share the same layout file.

TYPO3: 8.7.1
Server: Apache/2.4.7 (Ubuntu)
PHP: 7.0.17-2+deb.sury.org~trusty+1

TYPO3 is currently running in production context.

If you need any more information, just ask.

Related issues

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


Updated by Jay Dinse over 4 years ago

I have a similar problem. Fixed it by rename my Layout-File from "Default.html" to "Main.html" and used this name in my templates.

There must be some weird error in the fluid extension causing this.


Updated by Jacco van der Post over 4 years ago

I encounter this problem too on FluidTemplate for main config of site, no extensions installed except for own config extension. The layout file seems not to be allowed to be called 'Default'. When renaming it, no error anymore.


Updated by Philipp Idler over 4 years ago

I had a similar issue today and found a solution.
In former TYPO3 versions (< 8) you could declare your layout as "Default.html" and use it in your template with <f:layout name="default"/> (no case sensitive!).
Since TYPO3 8 the layout name is case sensitive, so check your templates and change your layout name to match the convention: <f:layout name="Default"/>

Please provide some feedback if it fixes your issue.


Updated by Clemens Riccabona over 4 years ago

  • Related to Bug #79760: FLUIDTEMPLATE not rendered when Layout name collides with Layout name of FSC added

Updated by Riccardo De Contardi about 4 years ago

  • Status changed from New to Closed

The patch from #79760 has been merged, so I close this one for now, as it should be solved. Please reopen if it occurs again (or ping me and I'll do that). Thank you!

Also available in: Atom PDF