[BUGFIX] Return correct available package information 55/55355/3
authorNicole Cordes <typo3@cordes.co>
Wed, 10 Jan 2018 16:40:39 +0000 (17:40 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 14 Jan 2018 11:35:11 +0000 (12:35 +0100)
The PackageManager needs to scan over all package location to be able
to decide whether a package is available or not.

Resolves: #83531
Releases: master, 8.7
Change-Id: Ib21c18a559b4c02d8efce146c8d5addf66b25f1f
Reviewed-on: https://review.typo3.org/55355
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Package/PackageManager.php

index bb4da75..eadbab3 100644 (file)
@@ -516,6 +516,11 @@ class PackageManager implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function isPackageAvailable($packageKey)
     {
+        // If activePackages is empty, the PackageManager is currently initializing
+        // thus packages should not be scanned
+        if (!$this->availablePackagesScanned && !empty($this->activePackages)) {
+            $this->scanAvailablePackages();
+        }
         if (isset($this->packageAliasMap[$lowercasedPackageKey = strtolower($packageKey)])) {
             $packageKey = $this->packageAliasMap[$lowercasedPackageKey];
         }