Skip to content

Commit

Permalink
[BUGFIX] Flush l10n cache after downloading languages
Browse files Browse the repository at this point in the history
This patch let's the Maintenance Area flush the `l10n` caches after
language packs were downloaded. Since the Install Tool uses
"hacked settings", we have to create a new instance of the `CacheManager`
to be able to operate on the mentioned cache. The same handling can be
seen in `ClearCacheService::clearAll()`.

Resolves: #84645
Releases: master
Change-Id: I221bd0d77f2991eac550316586002a8329bb36df
Reviewed-on: https://review.typo3.org/56583
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joshua Westerheide <account@jdoubleu.de>
Tested-by: Joshua Westerheide <account@jdoubleu.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
andreaskienast committed Apr 6, 2018
1 parent 94acfea commit 8a57e5b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions typo3/sysext/install/Classes/Controller/MaintenanceController.php
Expand Up @@ -680,6 +680,17 @@ public function languagePacksUpdateIsoTimesAction(ServerRequestInterface $reques
$isos = $request->getParsedBody()['install']['isos'];
$languagePackService = GeneralUtility::makeInstance(LanguagePackService::class);
$languagePackService->setLastUpdatedIsoCode($isos);

// The cache manager is already instantiated in the install tool
// with some hacked settings to disable caching of extbase and fluid.
// We want a "fresh" object here to operate on a different cache setup.
// cacheManager implements SingletonInterface, so the only way to get a "fresh"
// instance is by circumventing makeInstance and/or the objectManager and
// using new directly!
$cacheManager = new \TYPO3\CMS\Core\Cache\CacheManager();
$cacheManager->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
$cacheManager->getCache('l10n')->flush();

return new JsonResponse(['success' => true]);
}

Expand Down

0 comments on commit 8a57e5b

Please sign in to comment.