Project

General

Profile

Actions

Bug #66528

closed

PHP Warning: Invalid argument supplied for foreach() in RootlineUtility

Added by Xavier Perseguers over 9 years ago. Updated over 9 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-04-22
Due date:
% Done:

0%

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

Description

Appears with multilingual websites, most probably when the cache needs to be recreated.

Core: Error handler (FE): PHP Warning: Invalid argument supplied for foreach() in
/path/to/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 274
Actions #1

Updated by Xavier Perseguers over 9 years ago

  • Status changed from New to Accepted

Problem reproduced and located within a "faulty" extension providing an eID script.

Initialization of the TSFE:

    /**
     * Initializes TSFE and sets $GLOBALS['TSFE'].
     *
     * @return void
     */
    protected function initTSFE() {
        $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
            'TYPO3\\CMS\\Frontend\Controller\\TypoScriptFrontendController',
            $GLOBALS['TYPO3_CONF_VARS'],
            \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'),
            ''
        );
        $GLOBALS['TSFE']->initFEuser();
        $GLOBALS['TSFE']->checkAlternativeIdMethods();
        $GLOBALS['TSFE']->determineId();
        $GLOBALS['TSFE']->initTemplate();
        $GLOBALS['TSFE']->getConfigArray();

        // Get linkVars, absRefPrefix, etc
        \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
    }

Warning is triggered with ->determineId() since $GLOBALS['TCA'] is not set.

Problem may be solved by calling an internal bootstrap method, typically after the call to ->initFEuser() (to use same ordering as in bootstrap):

$GLOBALS['TSFE']->initFEuser();
\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca();
$GLOBALS['TSFE']->checkAlternativeIdMethods();
$GLOBALS['TSFE']->determineId();
$GLOBALS['TSFE']->initTemplate();
...

BEWARE: This only happens ONCE when eID script is called RIGHT AFTER FLUSHING the frontend cache

Actions #2

Updated by Markus Klein over 9 years ago

\TYPO3\CMS\Frontend\Utility\EidUtility::initTCA() maybe?

Actions #3

Updated by Xavier Perseguers over 9 years ago

  • Status changed from Accepted to Rejected
  • Target version deleted (7.2 (Frontend))
  • Sprint Focus deleted (Stabilization Sprint)

Indeed, thanks for pointing out.

Actions

Also available in: Atom PDF