#78800TCEForms Broken when TSFE is initialized during datamap-hook
Description
I have created an extension which makes use of typolink when a record is saved in the backend.
The save-procedure works flawless, but the resulting form (save, not save and close) is empty, instead of showing the updated data.
To reproduce register a datamap-hook in ext_localconf.php
$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['company_redirects'] = Vendor\Company\TceDatamap::class;
In the most minimal version that class contains the following code (which does nothing but produce the error)
namespace Vendor\Company;
class TceDatamap
{
public function processDatamap_afterDatabaseOperations($status, $table, $recordId, $databaseData, $pObj)
{
if ($table=='pages' && $status == 'update') {
$this->ensureTSFE($recordId);
}
}
protected function ensureTSFE($id = 1, $typeNum = 0)
{
if (!$GLOBALS['TSFE']) {
\TYPO3\CMS\Frontend\Utility\EidUtility::initTCA();
if (!is_object($GLOBALS['TT'])) {
$GLOBALS['TT'] = new \TYPO3\CMS\Core\TimeTracker\NullTimeTracker;
$GLOBALS['TT']->start();
}
$GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], $id, $typeNum);
$GLOBALS['TSFE']->sys_page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
$GLOBALS['TSFE']->sys_page->init(TRUE);
$GLOBALS['TSFE']->initFEuser();
$GLOBALS['TSFE']->determineId();
$GLOBALS['TSFE']->initTemplate();
$GLOBALS['TSFE']->rootLine = $GLOBALS['TSFE']->sys_page->getRootLine($id, '');
$GLOBALS['TSFE']->getConfigArray();
}
}
}Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.