Project

General

Profile

Actions

Bug #77651

closed

Having an initializeAction() changes the order in which TSFE->page is accessible leading to very hard debugable behaviour.

Added by S P about 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2016-08-29
Due date:
% Done:

0%

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

Description

In an Extbase extension I have a Controller with some actions. In some of these actions I change $GLOBALS['TSFE']->page (for example the title) - this works perfectly well up to the point where I add an initializeAction (empty or not, doesn't matter) to the controller. In this case the actual action can not access fields of $GLOBALS['TSFE']->page! Instead it will be created and hence never correctly populated by the core.

public function initializeAction() {
   // having or not having this empty function changes the behaviour of $this->showAction() wrt. $GLOBALS['TSFE']->page.
}

public function showAction() {
    $GLOBALS['TSFE']->page['title'] = 'foo';

    var_dump($GLOBALS['TSFE']->page);
    // with initializeAction it will only have the title set and will never be filled.
    // without initializeAction it will be filled first and then altered
}

I discovered this in TYPO3 7.6, it is possibly already in 6.2.

Actions

Also available in: Atom PDF