[BUGFIX] Display error message for "Check for broken extensions" 59/37059/2
authorNicole Cordes <typo3@cordes.co>
Thu, 19 Feb 2015 16:24:08 +0000 (17:24 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Fri, 20 Feb 2015 18:48:04 +0000 (19:48 +0100)
If you try to uninstall an extension, which is needed by another one,
the process triggers an error without any information for the user. This
patch catches the exception and shows it in frontend.

Releases: master, 6.2
Resolves: #63672
Change-Id: I339b3cb533e7ec22cbdd27a2661e1b775ac665c0
Reviewed-on: http://review.typo3.org/37059
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/install/Classes/Controller/Action/Ajax/UninstallExtension.php
typo3/sysext/install/Resources/Public/Javascript/Install.js

index 5ed7d39..8c02f83 100644 (file)
@@ -20,8 +20,6 @@ use TYPO3\CMS\Core\Utility;
  * Uninstall Extensions
  *
  * Used for uninstalling an extension (or multiple) via an ajax request.
- * Warning! No dependency checking is done here, the extension is just removed
- * from the extension list.
  *
  * If you use this class you have to take care of clearing the cache afterwards,
  * it's not done here because for fully clearing the cache you need a reload
@@ -33,9 +31,8 @@ class UninstallExtension extends AbstractAjaxAction {
        /**
         * Uninstall one or multiple extensions
         * Extension keys are read from get vars, more than one extension has to be comma separated
-        * Cache is cleared "hard" after uninstalling
         *
-        * @return string "OK"
+        * @return string "OK" on success, the error message otherwise
         */
        protected function executeAction() {
                $getVars = Utility\GeneralUtility::_GET('install');
@@ -43,7 +40,11 @@ class UninstallExtension extends AbstractAjaxAction {
                        $extensionsToUninstall = Utility\GeneralUtility::trimExplode(',', $getVars['uninstallExtension']['extensions']);
                        foreach ($extensionsToUninstall as $extension) {
                                if (Utility\ExtensionManagementUtility::isLoaded($extension)) {
-                                       Utility\ExtensionManagementUtility::unloadExtension($extension);
+                                       try {
+                                               Utility\ExtensionManagementUtility::unloadExtension($extension);
+                                       } catch (\Exception $e) {
+                                               return $e->getMessage();
+                                       }
                                }
                        }
                }
index fd150e2..ad8c45d 100644 (file)
@@ -586,7 +586,7 @@ function uninstallExtension(extension) {
                                } else {
                                        $('.message-loading', '#checkExtensions').hide();
                                        $('.message-error .message-body', '#checkExtensions').html(
-                                               'Something went wrong. Check failed.'
+                                               'Something went wrong. Check failed.' + '<p>Message:<br />' + data + '</p>'
                                        );
                                }
                        }