Bug #87546
closedPlease recreate all Caches after installing an extension
0%
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
Updated by Stefan Froemken almost 6 years ago
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');
Updated by Benni Mack over 5 years ago
- Target version changed from next-patchlevel to Candidate for patchlevel
Updated by Stefan Froemken over 5 years ago
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.
Updated by Gerrit Code Review over 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60718
Updated by Gerrit Code Review over 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60718