Added Feature #15604: Install-Tool usability: db compare shows no errors when db...
authorErnesto Baschny <ernst@cron-it.de>
Wed, 1 Dec 2010 16:26:46 +0000 (16:26 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Wed, 1 Dec 2010 16:26:46 +0000 (16:26 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9730 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/install/Resources/Private/Templates/GenerateUpdateDatabaseFormCheckboxes.html
typo3/sysext/install/mod/class.tx_install.php

index d9287eb..e00a96f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-12-01  Ernesto Baschny  <ernst@cron-it.de>
+
+       * Added Feature #15604: Install-Tool usability: db compare shows no errors when db-updates fail
+
 2010-12-01  Francois Suter  <francois@typo3.org>
 
        * Feature #16609: Usability: Add new label for workspace preview
index 046c89e..38d57c9 100644 (file)
@@ -33,6 +33,9 @@
                                                ###MESSAGE### <em>###VALUE###</em>
                                                <!-- ###CURRENT### end -->
                                        </label>
+                                       <!-- ###ERROR### begin -->
+                                       <p class="typo3-message message-error">###ERRORMESSAGE###</p>
+                                       <!-- ###ERROR### end -->
                                </li>
                                <!-- ###ROWS### end -->
                                <!-- ###WARNINGS### begin -->
index 9f8a7ac..11604ea 100755 (executable)
@@ -5681,16 +5681,26 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                                        $diff = $this->getDatabaseExtra($FDdb, $FDfile);
                                                        $remove_statements = $this->getUpdateSuggestions($diff,'remove');
 
-                                                       $this->performUpdateQueries($update_statements['clear_table'],$this->INSTALL['database_update']);
-
-                                                       $this->performUpdateQueries($update_statements['add'],$this->INSTALL['database_update']);
-                                                       $this->performUpdateQueries($update_statements['change'],$this->INSTALL['database_update']);
-                                                       $this->performUpdateQueries($remove_statements['change'],$this->INSTALL['database_update']);
-                                                       $this->performUpdateQueries($remove_statements['drop'],$this->INSTALL['database_update']);
-
-                                                       $this->performUpdateQueries($update_statements['create_table'],$this->INSTALL['database_update']);
-                                                       $this->performUpdateQueries($remove_statements['change_table'],$this->INSTALL['database_update']);
-                                                       $this->performUpdateQueries($remove_statements['drop_table'],$this->INSTALL['database_update']);
+                                                       $results = array();
+                                                       $results[] = $this->performUpdateQueries($update_statements['clear_table'], $this->INSTALL['database_update']);
+
+                                                       $results[] = $this->performUpdateQueries($update_statements['add'], $this->INSTALL['database_update']);
+                                                       $results[] = $this->performUpdateQueries($update_statements['change'], $this->INSTALL['database_update']);
+                                                       $results[] = $this->performUpdateQueries($remove_statements['change'], $this->INSTALL['database_update']);
+                                                       $results[] = $this->performUpdateQueries($remove_statements['drop'], $this->INSTALL['database_update']);
+
+                                                       $results[] = $this->performUpdateQueries($update_statements['create_table'], $this->INSTALL['database_update']);
+                                                       $results[] = $this->performUpdateQueries($remove_statements['change_table'], $this->INSTALL['database_update']);
+                                                       $results[] = $this->performUpdateQueries($remove_statements['drop_table'], $this->INSTALL['database_update']);
+                                                       
+                                                       $this->databaseUpdateErrorMessages = array();
+                                                       foreach ($results as $resultSet) {
+                                                               if (is_array($resultSet)) {
+                                                                       foreach ($resultSet as $key => $errorMessage) {
+                                                                               $this->databaseUpdateErrorMessages[$key] = $errorMessage;
+                                                                       }
+                                                               }
+                                                       }
                                                }
 
                                                        // Init again / first time depending...
@@ -8240,6 +8250,31 @@ $out="
                                        '###CURRENT###',
                                        $currentSubpart
                                );
+
+                               $errorSubpart = '';
+                               if (isset($this->databaseUpdateErrorMessages[$key])) {
+                                               // Get the subpart for current
+                                       $errorSubpart = t3lib_parsehtml::getSubpart($rowsSubpart, '###ERROR###');
+                                               // Define the markers content
+                                       $currentMarkers = array (
+                                               'errorMessage' => $this->databaseUpdateErrorMessages[$key],
+                                       );
+                                               // Fill the markers in the subpart
+                                       $errorSubpart = t3lib_parsehtml::substituteMarkerArray(
+                                               $errorSubpart,
+                                               $currentMarkers,
+                                               '###|###',
+                                               TRUE,
+                                               FALSE
+                                       );
+                               }
+                                       // Substitute the subpart for error messages
+                               $rowsSubpart = t3lib_parsehtml::substituteSubpart(
+                                       $rowsSubpart,
+                                       '###ERROR###',
+                                       $errorSubpart
+                               );
+
                                        // Fill the markers in the subpart
                                $rowsSubpart = t3lib_parsehtml::substituteMarkerArray(
                                        $rowsSubpart,