[BUGFIX] Skip updates if InitialUpdateDatabaseSchema is needed 20/35020/2
authorMarkus Klein <klein.t3@reelworx.at>
Thu, 4 Dec 2014 01:23:44 +0000 (02:23 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 16 Jan 2015 20:14:07 +0000 (21:14 +0100)
In case the InitialUpdateDatabaseSchema needs to add fields
to the database, we must not run any checks (like checkForUpdate)
of other updates, since they may require a new field to
be present already in the database, which would lead to
SQL errors.

Resolves: #63556
Releases: master
Change-Id: I39454c9bacc187276bf30fd55cd06874048d3d6a
Reviewed-on: http://review.typo3.org/35020
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php

index 9e2b188..a50d559 100644 (file)
@@ -105,6 +105,10 @@ class UpgradeWizard extends Action\AbstractAction {
                                );
                                if ($identifier === 'initialUpdateDatabaseSchema') {
                                        $availableUpdates['initialUpdateDatabaseSchema']['renderNext'] = $this->needsInitialUpdateDatabaseSchema;
+                                       // initialUpdateDatabaseSchema is always the first update
+                                       // we stop immediately here as the remaining updates may
+                                       // require the new fields to be present in order to avoid SQL errors
+                                       break;
                                } elseif ($identifier === 'finalUpdateDatabaseSchema') {
                                        // Okay to check here because finalUpdateDatabaseSchema is last element in array
                                        $availableUpdates['finalUpdateDatabaseSchema']['renderNext'] = count($availableUpdates) === 1;