[BUGFIX] Ignore dependencies of inactive packages 19/26719/5
authorHelmut Hummel <helmut.hummel@typo3.org>
Thu, 9 Jan 2014 12:25:23 +0000 (13:25 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 13 Jan 2014 17:21:51 +0000 (18:21 +0100)
It might happen that activating or deactivating
a package throws an exception because other inactive
packages are available on the system with broken or
not fulfilled dependencies.

To solve this issue, only active packages
are regarded when resolving dependencies.

To remove a side effect from this change,
cache clearing in extension manager is
moved to a later point (see #54951).

This needs a proper fix in another change,
but makes this fix work for now.

Resolves: #54879
Releases: 6.2
Change-Id: Id81b66b2d2b6f4ba7d1c6ea2d001c271982539b3
Reviewed-on: https://review.typo3.org/26719
Reviewed-by: Thomas Maroschik
Reviewed-by: Markus Klein
Tested-by: Kasper Ligaard
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/core/Classes/Package/PackageManager.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php

index 23a84d1..6f3c219 100644 (file)
@@ -784,4 +784,17 @@ class PackageManager extends \TYPO3\Flow\Package\PackageManager implements \TYPO
                $this->packages = $newPackages;
                $this->packageStatesConfiguration['packages'] = $newPackageStatesConfiguration;
        }
+
+       /**
+        * Resolves the dependent packages from the meta data of all packages recursively. The
+        * resolved direct or indirect dependencies of each package will put into the package
+        * states configuration array.
+        *
+        * @return void
+        */
+       protected function resolvePackageDependencies() {
+               foreach ($this->activePackages as $packageKey => $package) {
+                       $this->packageStatesConfiguration['packages'][$packageKey]['dependencies'] = $this->getDependencyArrayForPackage($packageKey);
+               }
+       }
 }
index bbe5a7a..1898356 100644 (file)
@@ -116,15 +116,15 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
                $this->processDatabaseUpdates($extension);
                $this->ensureConfiguredDirectoriesExist($extension);
                $this->importInitialFiles($extension['siteRelPath'], $extensionKey);
-               if ($extension['clearcacheonload']) {
-                       $GLOBALS['typo3CacheManager']->flushCaches();
-               }
                if (!$this->isLoaded($extensionKey)) {
                        $this->loadExtension($extensionKey);
                }
                $this->reloadCaches();
                $this->processCachingFrameworkUpdates();
                $this->saveDefaultConfiguration($extension['key']);
+               if ($extension['clearcacheonload']) {
+                       $GLOBALS['typo3CacheManager']->flushCaches();
+               }
        }
 
        /**