[BUGFIX] Prevent wrong information after extension upload 81/39181/2
authorNicole Cordes <typo3@cordes.co>
Sat, 2 May 2015 08:58:45 +0000 (10:58 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 2 May 2015 09:37:36 +0000 (11:37 +0200)
If you upload an extension it is extracted and installed in separate
steps. If the extraction was successful a flash message is rendered.
If the installation fails the whole extension is removed again but the
flash message is still visible. This patch separates flash message output
for upload and installation process.

Releases: master, 6.2
Resolves: #66729
Change-Id: I6d84d8ecebd55a989a34c1024300916e33af66a7
Reviewed-on: http://review.typo3.org/39181
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/extensionmanager/Classes/Controller/UploadExtensionFileController.php

index b4515df..66e3181 100644 (file)
@@ -97,13 +97,14 @@ class UploadExtensionFileController extends AbstractController {
                                );
                        }
                        $extensionData = $this->extractExtensionFromFile($tempFile, $fileName, $overwrite);
-                       $this->addFlashMessage(
-                               htmlspecialchars($this->translate('extensionList.uploadFlashMessage.message', array($extensionData['extKey']))),
-                               htmlspecialchars($this->translate('extensionList.uploadFlashMessage.title')),
-                               FlashMessage::OK
-                       );
                        $emConfiguration = $this->configurationUtility->getCurrentConfiguration('extensionmanager');
-                       if ($emConfiguration['automaticInstallation']['value']) {
+                       if (!$emConfiguration['automaticInstallation']['value']) {
+                               $this->addFlashMessage(
+                                       htmlspecialchars($this->translate('extensionList.uploadFlashMessage.message', array($extensionData['extKey']))),
+                                       htmlspecialchars($this->translate('extensionList.uploadFlashMessage.title')),
+                                       FlashMessage::OK
+                               );
+                       } else {
                                $this->activateExtension($extensionData['extKey']);
                                $this->addFlashMessage(
                                        htmlspecialchars($this->translate('extensionList.installedFlashMessage.message', array($extensionData['extKey']))),