[TASK] Add clear l10n cache when the user clear all cache
authorDominique Feyer <dfeyer@ttree.ch>
Thu, 15 Dec 2011 14:47:52 +0000 (15:47 +0100)
committerXavier Perseguers <xavier@typo3.org>
Mon, 27 Feb 2012 21:28:15 +0000 (22:28 +0100)
Currently the l10n parser cache can only be cleared manually, by adding this in locallang.php:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['cache']['clear_menu'] = TRUE;

This patch change the default behavior. By default the l10n cache is cleared on "clear all cache",
if the clear l10n menu item is enabled, it's not cleared on clear all cache.

Change-Id: I61568b93ccec35ccb6d7f2f362c29ddf8b3365cd
Fixes: #32600
Releases: 4.7, 4.6
Reviewed-on: http://review.typo3.org/7358
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
Reviewed-by: Dominique Feyer
Tested-by: Dominique Feyer
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/lang/ext_localconf.php

index 26ec14a..cf211bc 100644 (file)
@@ -15,6 +15,9 @@ if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][
 if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['cache']['clear_menu']) && $GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['cache']['clear_menu']) {
                // Register Clear Cache Menu hook
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions']['clearLangCache'] = 'EXT:lang/hooks/clearcache/class.tx_lang_clearcachemenu.php:&tx_lang_clearcachemenu';
+} else {
+               // Clear l10n cache when the user clears all caches
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['clearLangCache'] = 'EXT:lang/hooks/clearcache/class.tx_lang_clearcache.php:tx_lang_clearcache->clearCache';
 }
 
        // Register Ajax call