[BUGFIX] Prevent installation of incompatible extensions 27/50427/3
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:42:58 +0000 (22:42 +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.

Resolves: #78494
Resolves: #76542
Releases: master, 7.6, 6.2
Change-Id: I0fb2b4632bef05912a329553b70f26d614a1ba9c
Reviewed-on: https://review.typo3.org/50427
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Helmut Hummel <typo3@helhum.io>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
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 28f7234..9709562 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 6828c5b..14f6a02 100644 (file)
@@ -180,7 +180,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'])) {
@@ -325,13 +325,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])) {