Issue Bug Closed

#66278RequestHandler creates $GLOBALS['TSFE'] incomplete

Anja Leichsenring 04/05/15, 12:39 updated 10/19/17, 21:15

Description

I am not sure how to reproduce the original issue, but here is my story:
I was testing https://review.typo3.org/#/c/8719/, so I followed the reproduce instruction in the ticket.
Some time everything went well, but all of a sudden my frontend responded with two errors:

Warning: Invalid argument supplied for foreach() in /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php on line 4095
Call Stack: 0.0000 238920 
1. {main}() /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/index.php:0 0.0023 1222392 
2. TYPO3\CMS\Core\Core\Bootstrap->run() /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/index.php:33 0.0202 2775632 
3. TYPO3\CMS\Frontend\RequestHandler->handleRequest() /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/typo3/sysext/core/Classes/Core/Bootstrap.php:195 0.4188 6539192
4. TYPO3\CMS\Backend\FrontendBackendUserAuthentication->initializeFrontendEdit() /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/typo3/sysext/frontend/Classes/RequestHandler.php:150 0.4188 6539592 
5. TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->getPagesTSconfig() /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php:123 

Fatal error: Call to a member function getHash() on a non-object in /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php on line 4102 
Call Stack: 0.0000 238920 
1. {main}() /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/index.php:0 0.0023 1222392 
2. TYPO3\CMS\Core\Core\Bootstrap->run() /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/index.php:33 0.0202 2775632 
3. TYPO3\CMS\Frontend\RequestHandler->handleRequest() /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/typo3/sysext/core/Classes/Core/Bootstrap.php:195 0.4188 6539192 
4. TYPO3\CMS\Backend\FrontendBackendUserAuthentication->initializeFrontendEdit() /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/typo3/sysext/frontend/Classes/RequestHandler.php:150 0.4188 6539592 
5. TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->getPagesTSconfig() /var/www/typo3-testing.de/vhosts/master/htdocs/TYPO3.CMS/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php:123

After some investigation we found out, that the request handler rebrush (#65914) was the change that introduced this error.

Even after undoing all the changes I did in my environment, hard resetting the master branch, flushing all the caches several times, for me the error persists.
Changing the line 360 in typo3/sysext/frontend/Classes/RequestHandler.php from
@$GLOBALS[‘TSFE’] = $this->controller;@ to $GLOBALS['TSFE'] = &$this->controller; brought my frontend back.

Reviews 1