[BUGFIX] Install tool fatal errors at select database action 98/53498/3
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 09:36:36 +0000 (11:36 +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/53498
Reviewed-by: Wolfgang Klinger <wolfgang@wazum.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe <philipp.gampe@typo3.org>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Reviewed-by: Henning Liebe <h.liebe@neusta.de>
Tested-by: Henning Liebe <h.liebe@neusta.de>
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 1f786bd..2f81335 100644 (file)
@@ -85,11 +85,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: