[BUGFIX] Resolve dependencies on extension update 97/37497/5
authorNicole Cordes <typo3@cordes.co>
Tue, 3 Mar 2015 13:32:07 +0000 (14:32 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 14 May 2015 14:40:31 +0000 (16:40 +0200)
For installed extensions the (new) dependencies have to be resolved
on extension update. If the extension isn't installed yet,
the dependencies are fetched on update anyway,
so this doesn't have to be tackled.

Releases: master, 6.2
Resolves: #65484
Change-Id: I5c1e8622b3b15b6c25d7181c6cb1fc07f271437d
Reviewed-on: http://review.typo3.org/37497
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php

index e9efee9..3503004 100644 (file)
@@ -197,8 +197,14 @@ class DownloadController extends AbstractController {
                if (!$extension instanceof Extension) {
                        $extension = $this->extensionRepository->findHighestAvailableVersion($extensionKey);
                }
+               $installedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
                try {
-                       $this->managementService->downloadMainExtension($extension);
+                       if (in_array($extensionKey, $installedExtensions, TRUE)) {
+                               // To resolve new dependencies the extension is installed again
+                               $this->managementService->installExtension($extension);
+                       } else {
+                               $this->managementService->downloadMainExtension($extension);
+                       }
                        $this->addFlashMessage(
                                htmlspecialchars($this->translate('extensionList.updateFlashMessage.body', array($extensionKey))),
                                $this->translate('extensionList.updateFlashMessage.title')