[BUGFIX] Activate runtimeActivatedPackages without cache clearing 27/39227/4
authorNicole Cordes <typo3@cordes.co>
Sun, 3 May 2015 08:54:25 +0000 (10:54 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sun, 3 May 2015 11:44:02 +0000 (13:44 +0200)
Currently you have to clear all caches manually to use runtime activated
packages because they are not included in the building process of the
cache identifier. This patch defines the TYPO3_CONF_VARS setting per
default and includes it in the cache identifier. Furthermore runtime
activated packages are excluded from being disabled in EM.

Release: master, 6.2
Resolves: #66768
Resolves: #58874
Change-Id: Idbda3c4f1f3c827c2b26c6f7759a9121cc260068
Reviewed-on: http://review.typo3.org/39227
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/ToggleExtensionInstallationStateViewHelper.php

index d52f84c..714e503 100644 (file)
@@ -474,7 +474,7 @@ class Bootstrap {
         * @return Bootstrap
         */
        protected function initializeRuntimeActivatedPackagesFromConfiguration() {
-               if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages'])) {
+               if (!empty($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages'])) {
                        /** @var \TYPO3\CMS\Core\Package\PackageManager $packageManager */
                        $packageManager = $this->getEarlyInstance(\TYPO3\Flow\Package\PackageManager::class);
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages'] as $runtimeAddedPackageKey) {
index 73d0f57..1a18b18 100644 (file)
@@ -1562,7 +1562,7 @@ tt_content.' . $key . $suffix . ' {
         * @return string
         */
        static protected function getExtLocalconfCacheIdentifier() {
-               return 'ext_localconf_' . sha1((TYPO3_version . PATH_site . 'extLocalconf'));
+               return 'ext_localconf_' . sha1(TYPO3_version . PATH_site . 'extLocalconf' . serialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']));
        }
 
        /**
@@ -1689,7 +1689,7 @@ tt_content.' . $key . $suffix . ' {
         * @return string
         */
        static protected function getBaseTcaCacheIdentifier() {
-               return 'tca_base_' . sha1((TYPO3_version . PATH_site . 'tca'));
+               return 'tca_base_' . sha1(TYPO3_version . PATH_site . 'tca' . serialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']));
        }
 
        /**
@@ -1835,7 +1835,7 @@ tt_content.' . $key . $suffix . ' {
         * @return string
         */
        static protected function getExtTablesCacheIdentifier() {
-               return 'ext_tables_' . sha1((TYPO3_version . PATH_site . 'extTables'));
+               return 'ext_tables_' . sha1(TYPO3_version . PATH_site . 'extTables' . serialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']));
        }
 
        /**
index 92b1f36..137ce5a 100644 (file)
@@ -301,6 +301,7 @@ return array(
                                ),
                        )),
                ),
+               'runtimeActivatedPackages' => array(),
        ),
        'BE' => array(
                // Backend Configuration.
index 9d33ab0..2f7bf9f 100644 (file)
@@ -34,11 +34,11 @@ class ToggleExtensionInstallationStateViewHelper extends \TYPO3\CMS\Fluid\ViewHe
         * @return string the rendered a tag
         */
        public function render($extension) {
-               // Early return if package is protected and can not be unloaded
+               // Early return if package is protected or is a runtime actived package and can not be unloaded
                /** @var $packageManager \TYPO3\CMS\Core\Package\PackageManager */
                $packageManager = $this->objectManager->get(\TYPO3\CMS\Core\Package\PackageManager::class);
                $package = $packageManager->getPackage($extension['key']);
-               if ($package->isProtected()) {
+               if ($package->isProtected() || in_array($extension['key'], $GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages'])) {
                        return '';
                }