Project

General

Profile

Actions

Bug #87546

closed

Please recreate all Caches after installing an extension

Added by Stefan Froemken about 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extension Manager
Start date:
2019-01-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Actions #1

Updated by Stefan Froemken about 5 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');
Actions #2

Updated by Benni Mack almost 5 years ago

  • Target version changed from next-patchlevel to Candidate for patchlevel
Actions #3

Updated by Stefan Froemken almost 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.

Actions #4

Updated by Gerrit Code Review almost 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

Actions #5

Updated by Gerrit Code Review almost 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

Actions #6

Updated by Georg Ringer about 4 years ago

  • Status changed from Under Review to Closed

Closed in 10

Actions

Also available in: Atom PDF