[BUGFIX] Prevent installation of incompatible extensions 34/50434/2
authorNicole Cordes <typo3@cordes.co>
Fri, 28 Oct 2016 22:16:58 +0000 (00:16 +0200)
committerBenni Mack <benni@typo3.org>
Sat, 29 Oct 2016 20:43:41 +0000 (22:43 +0200)
If an extension is installed, all information are gathered from database.
Here also a check for possible update versions is triggered. In this
check potential dependency updates are marked which get installed during
the underlying extension installation.
This patch prevents gathering TER information during an installation
process to prevent any update information to be registered.

Change-Id: I1188803335c16c3a8f0c963f611d33b3b495433e
Resolves: #78494
Resolves: #76542
Releases: master, 7.6, 6.2
Reviewed-on: https://review.typo3.org/50434
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/extensionmanager/Classes/Controller/ActionController.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php

index 0d992e2..c0e8647 100644 (file)
@@ -87,7 +87,7 @@ class ActionController extends AbstractController
             } else {
                 // install
                 $extension = $this->extensionModelUtility->mapExtensionArrayToModel(
-                    $this->installUtility->enrichExtensionWithDetails($extensionKey)
+                    $this->installUtility->enrichExtensionWithDetails($extensionKey, false)
                 );
                 if ($this->managementService->installExtension($extension) === false) {
                     $this->redirect('unresolvedDependencies', 'List', null, ['extensionKey' => $extensionKey]);
index 960be71..8b0ae28 100644 (file)
@@ -178,7 +178,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function install($extensionKey)
     {
-        $extension = $this->enrichExtensionWithDetails($extensionKey);
+        $extension = $this->enrichExtensionWithDetails($extensionKey, false);
         $this->ensureConfiguredDirectoriesExist($extension);
         $this->loadExtension($extensionKey);
         if (!empty($extension['clearcacheonload']) || !empty($extension['clearCacheOnLoad'])) {
@@ -323,13 +323,18 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface
      * Fetch additional information for an extension key
      *
      * @param string $extensionKey
+     * @param bool $loadTerInformation
      * @access private
      * @return array
      * @throws ExtensionManagerException
      */
-    public function enrichExtensionWithDetails($extensionKey)
+    public function enrichExtensionWithDetails($extensionKey, $loadTerInformation = true)
     {
         $extension = $this->getExtensionArray($extensionKey);
+        if (!$loadTerInformation) {
+            return $extension;
+        }
+
         $availableAndInstalledExtensions = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation([$extensionKey => $extension]);
 
         if (!isset($availableAndInstalledExtensions[$extensionKey])) {