[BUGFIX] Extension update fails if needed by other extensions 83/28883/3
authorNicole Cordes <typo3@cordes.co>
Wed, 26 Mar 2014 20:17:13 +0000 (21:17 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Sat, 29 Mar 2014 09:33:23 +0000 (10:33 +0100)
On update process the extension which should be updated gets
uninstalled. This doesn't work if the extension is needed by other ones.
This patch removes the unload process before the update to make sure
system is working in the mean time.

Resolves: #57264
Releases: 6.2
Change-Id: I6f54cf8ba977e9c8038790ea3857ba6fff61a5f9
Reviewed-on: https://review.typo3.org/28883
Reviewed-by: Cedric Ziel
Tested-by: Cedric Ziel
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php

index c4c34d6..d4ee7ff 100644 (file)
@@ -153,21 +153,6 @@ class DownloadController extends \TYPO3\CMS\Extensionmanager\Controller\Abstract
        }
 
        /**
-        * Prepares an extension for import from TER
-        * Uninstalls the extension if it is already loaded (case: update)
-        * and reloads the caches.
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
-        * @return void
-        */
-       protected function prepareExtensionForImport(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension) {
-               if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extension->getExtensionKey())) {
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::unloadExtension($extension->getExtensionKey());
-                       $this->installUtility->reloadCaches();
-               }
-       }
-
-       /**
         * Update an extension. Makes no sanity check but directly searches highest
         * available version from TER and updates. Update check is done by the list
         * already. This method should only be called if we are sure that there is
@@ -179,7 +164,6 @@ class DownloadController extends \TYPO3\CMS\Extensionmanager\Controller\Abstract
                $extensionKey = $this->request->getArgument('extension');
                /** @var $highestTerVersionExtension \TYPO3\CMS\Extensionmanager\Domain\Model\Extension */
                $highestTerVersionExtension = $this->extensionRepository->findHighestAvailableVersion($extensionKey);
-               $this->prepareExtensionForImport($highestTerVersionExtension);
                $result = $this->managementService->resolveDependenciesAndInstall($highestTerVersionExtension);
                $this->view->assign('result', $result)->assign('extension', $highestTerVersionExtension);
        }
@@ -216,7 +200,6 @@ class DownloadController extends \TYPO3\CMS\Extensionmanager\Controller\Abstract
                $errorMessage = '';
                try {
                        $this->downloadUtility->setDownloadPath($downloadPath);
-                       $this->prepareExtensionForImport($extension);
                        $result = $this->managementService->resolveDependenciesAndInstall($extension);
                } catch (\TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException $e) {
                        $errorMessage = $e->getMessage();