Issue Bug Closed

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

S P 08/29/16, 08:28 updated 01/25/17, 22:38

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.