[BUGFIX] ClearCacheOnLoad camelCased does not work 94/31394/2
authorSusanne Moog <typo3@susannemoog.de>
Sun, 6 Jul 2014 15:10:10 +0000 (17:10 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 6 Jul 2014 15:29:22 +0000 (17:29 +0200)
The em_conf setting "clearCacheOnLoad" is both used in
camelCase and lower case but only the latter one is
supported by the extension manager.

Change-Id: I637ace3bef07353b7a44c991f79d01da8e8b5547
Fixes: #60127
Releases: 6.2,6.3
Reviewed-on: https://review.typo3.org/31394
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/InstallUtilityTest.php

index 42653d1..71190e3 100644 (file)
@@ -106,7 +106,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
                $this->reloadCaches();
                $this->processRuntimeDatabaseUpdates($extensionKey);
                $this->saveDefaultConfiguration($extension['key']);
-               if ($extension['clearcacheonload']) {
+               if (!empty($extension['clearcacheonload']) || !empty($extension['clearCacheOnLoad'])) {
                        $this->cacheManager->flushCaches();
                } else {
                        $this->cacheManager->flushCachesInGroup('system');
index 655f3b8..a29801e 100644 (file)
@@ -147,6 +147,17 @@ class InstallUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @test
         */
+       public function installCallsFlushCachesIfClearCacheOnLoadCamelCasedIsSet() {
+               $this->extensionData['clearCacheOnLoad'] = TRUE;
+               $cacheManagerMock = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager');
+               $cacheManagerMock->expects($this->once())->method('flushCaches');
+               $this->installMock->_set('cacheManager', $cacheManagerMock);
+               $this->installMock->install($this->extensionKey);
+       }
+
+       /**
+        * @test
+        */
        public function installationOfAnExtensionWillCallEnsureThatDirectoriesExist() {
                $cacheManagerMock = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager');
                $cacheManagerMock->expects($this->once())->method('flushCachesInGroup');