Project

General

Profile

Actions

Bug #67544

closed

FLUIDTEMPLATE fatal error when cached

Added by Philipp Wrann almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Fluid
Target version:
Start date:
2015-06-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I upgraded from 7.2 to 7.3 and noticed this fatal error:
Fatal error: Call to a member function getOrNull() on null in /var/www/PROJECT/htdocs/typo3temp/Cache/Code/fluid_template/Standalone_template_file_OneColumn_9bebc50e0021df52feceee91be3379cc3b969664.php on line 10

those are the first lines of the generated templte:

<?php
class FluidCache_Standalone_template_file_OneColumn_9bebc50e0021df52feceee91be3379cc3b969664 extends \TYPO3\CMS\Fluid\Core\Compiler\AbstractCompiledTemplate {

public function getVariableContainer() {
    // @todo
    return new \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer();
}
public function getLayoutName(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext) {

return $currentVariableContainer->getOrNull('layout');
}

As you see the method body "return $currentVariableContainer->getOrNull('layout')"; is not generated correctly, there is missing something.

The Template is like this:

<f:layout name="{layout}" />

<f:section name="Main">
    <main id="main-content" itemprop="mainContentOfPage" role="main">
        <!--TYPO3SEARCH_begin-->
        <f:cObject typoscriptObjectPath="lib.contents.header" />
        <!--TYPO3SEARCH_end-->
    </main>    
</f:section>

The FLUIDCONTENT like this:

page.10 < lib.fluidTemplate
page.10 {
    templateName = TEXT
    templateName.stdWrap.cObject = CASE
    templateName.stdWrap.cObject {
        key.data = levelfield:-1,backend_layout_next_level,slide
        key.override.field = backend_layout

        default = TEXT
        default.value = HeaderContentSidebar

        1 = TEXT
        1.value = OneColumn

        2 = TEXT
        2.value = OneColumnNoLayout

        3 = TEXT
        3.value = HeaderSidebarContent

        4 = TEXT
        4.value = HeaderContentSidebar

        5 = TEXT
        5.value = HeaderSidebarContentSidebar
    }

    variables {
        searchResultsPageUid = TEXT
        searchResultsPageUid.value = 6
        footerContactContentElementUid = TEXT
        footerContactContentElementUid.value = 1
        title = TEXT
        title.data = page:title
        description = TEXT
        description.data = levelfield:-1, description, slide
        pageUid = TEXT
        pageUid.data = TSFE:id
        layout = TEXT
        layout.value = PageWrap
    }

    extbase {
        pluginName = Pi1
        controllerExtensionName = Page
        controllerName = Page
        controllerActionName = layout
    }
}

lib.fluidTemplate = FLUIDTEMPLATE
lib.fluidTemplate {
    partialRootPaths.10 = typo3conf/ext/page/Resources/Private/Partials/
    layoutRootPaths.10 = typo3conf/ext/page/Resources/Private/Layouts/
    templateRootPaths.10 = typo3conf/ext/page/Resources/Private/Templates/
    variables {

    }
}

Did i make a mistake? Dont think so.


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #67595: Variable in f:layout name leads to fatal error on second page loadClosed2015-06-18

Actions
Actions #1

Updated by Mathias Schreiber almost 9 years ago

  • Status changed from New to Accepted

We're taking a look.

Actions #2

Updated by Philipp Wrann almost 9 years ago

The method $parsingState->getLayoutNameNode() returns a RootNode, that does not fit the layout process.

If i switch the layout definition to

<f:layout name="StaticString" /> <- no variable in name argument

A TextNode is returned.

Actions #3

Updated by Philipp Wrann almost 9 years ago

But uncached it works, so it cant be the variable itself, i think there is some of caching problem with the variable-container set via TS.

Actions #4

Updated by Mathias Schreiber almost 9 years ago

  • Status changed from Accepted to Closed

we'll continue in the related issue, since it has a patch already :)

Actions

Also available in: Atom PDF