Bug #62263
closed
eID gives Invalid argument supplied for foreach() RootlineUtility.php line 271
Added by Job Rutgers about 10 years ago.
Updated almost 10 years ago.
Description
I get a warning when I use an eID
PHP Warning: Invalid argument supplied for foreach() in typo3/sysext/core/Classes/Utility/RootlineUtility.php line 271
I use the following settings
$TSFE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], 0, 0);
\TYPO3\CMS\Frontend\Utility\EidUtility::initLanguage();
$TSFE->initFEuser();
$TSFE->set_no_cache();
$TSFE->checkAlternativeIdMethods();
$TSFE->determineId();
$TSFE->initTemplate();
$TSFE->getConfigArray();
\TYPO3\CMS\Core\Core\Bootstrap::getInstance();
$TSFE->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
$TSFE->settingLanguage();
$TSFE->settingLocale();
I found a solution in https://github.com/helhum/ajax_example from Helmut Hummel
use \TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3\CMS\Frontend\Utility\EidUtility;
GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Core\\Bootstrap');
$feUserObj = EidUtility::initFeUser();
$pageId = GeneralUtility::_GET('id') ?: 1;
$typoScriptFrontendController = GeneralUtility::makeInstance(
'TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController',
$GLOBALS['TYPO3_CONF_VARS'],
$pageId,
0,
TRUE
);
$GLOBALS['TSFE'] = $typoScriptFrontendController;
$typoScriptFrontendController->connectToDB();
$typoScriptFrontendController->fe_user = $feUserObj;
$typoScriptFrontendController->set_no_cache();
$typoScriptFrontendController->id = $pageId;
$typoScriptFrontendController->determineId();
$typoScriptFrontendController->getCompressedTCarray();
$typoScriptFrontendController->initTemplate();
$typoScriptFrontendController->getConfigArray();
$typoScriptFrontendController->includeTCA();
$typoScriptFrontendController->cObj = GeneralUtility::makeInstance('TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
- Status changed from New to Needs Feedback
- Target version deleted (
next-patchlevel)
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
Also available in: Atom
PDF