Bug #87546
Please recreate all Caches after installing an extension
Added by Stefan Froemken about 2 years ago.
Updated 12 months ago.
Category:
Extension Manager
Description
Hello Core-Team,
I have registered a Cache which I need while processing TCA, but that Cache does not exists while installing my extension.
you have following lines in InstallUtilit:
public function reloadCaches()
{
$this->reloadOpcache();
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtLocalconf(false);
\TYPO3\CMS\Core\Core\Bootstrap::loadBaseTca(false);
\TYPO3\CMS\Core\Core\Bootstrap::loadExtTables(false);
}
With loadExtLocalconf(false); my Cache will be Added to TYPO3_CONF_VARS, but CacheManager will not be called again, so while processing next line "loadBaseTca" TCA and Overrides will be loaded, but as my Cache is un-initialized an Exception will be thrown.
Stefan
I found a solution for me. But would be still cool to have that in Core:
if ($this->cacheManager->hasCache('maps2_registry') === false) {
// Seems we are in ExtensionManager or Installtool.
// TYPO3 missed to reload CacheConfigurations right after loading ext_localconf.php and before loading TCA.
$this->cacheManager->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
$this->cacheManager->flushCachesInGroup('system');
}
$this->maps2RegistryCache = $this->cacheManager->getCache('maps2_registry');
- Target version changed from next-patchlevel to Candidate for patchlevel
I just have found these lines in Bootstrap.php:
$this->startOutputBuffering()
->loadConfigurationAndInitialize()
->loadTypo3LoadedExtAndExtLocalconf(true)
->setFinalCachingFrameworkCacheConfiguration()
->defineLoggingAndExceptionConstants()
->unsetReservedGlobalVariables()
As you can see, you initialize CacheManager configuration just after loading ext_localconf.php. Maybe the same method can be used in InstallUtility, too.
- Status changed from New to Under Review
- Status changed from Under Review to Closed
Also available in: Atom
PDF