[BUGFIX] Install tool fatal errors at select database action 29/53629/2
authorMarkus Hoelzle <typo3@markus-hoelzle.de>
Fri, 14 Jul 2017 21:20:18 +0000 (23:20 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Mon, 31 Jul 2017 12:33:55 +0000 (14:33 +0200)
Catch the fatal database exceptions in installation progress
"DatabaseSelect" and show a error message.

Releases: 8.7, master
Resolves: #81726
Change-Id: Id7edbdaafa97374451493d6bb9c9fdaabd2f2674
Reviewed-on: https://review.typo3.org/53629
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseSelect.php
typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseSelect.html

index 8c5a883..44228e6 100644 (file)
@@ -90,11 +90,17 @@ class DatabaseSelect extends AbstractStepAction
      */
     protected function executeAction()
     {
+        $errors = [];
         /** @var $configurationManager ConfigurationManager */
         $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
         $isInitialInstallationInProgress = $configurationManager
             ->getConfigurationValueByPath('SYS/isInitialInstallationInProgress');
-        $this->view->assign('databaseList', $this->getDatabaseList($isInitialInstallationInProgress));
+        try {
+            $this->view->assign('databaseList', $this->getDatabaseList($isInitialInstallationInProgress));
+        } catch (\Exception $exception) {
+            $errors[] = $exception->getMessage();
+        }
+        $this->view->assign('errors', $errors);
         $this->view->assign('isInitialInstallationInProgress', $isInitialInstallationInProgress);
         $this->assignSteps();
         return $this->view->render();
index 24344b3..9674739 100644 (file)
@@ -7,6 +7,15 @@
 
        <h3>Select database</h3>
 
+       <f:if condition="{errors -> f:count()}">
+               <f:for each="{errors}" as="error">
+                       <div class="alert alert-danger">
+                               <h4>Exception</h4>
+                               <p>{error}</p>
+                       </div>
+               </f:for>
+       </f:if>
+
        <f:if condition="{isInitialInstallationInProgress}">
                <f:then>
                        You have two options: