Skip to content

Commit

Permalink
[BUGFIX] Catch error in database Upgrade Wizard
Browse files Browse the repository at this point in the history
If an extension provides wrong SQL in ext_tables.sql, the upgrade
wizard is skipped completely. This patch catches the current
exception and outputs the error that needs to be resolved manually.

Resolves: #87187
Releases: master, 9.5
Change-Id: I903ce7fdc9373eee66da7bed86698c42a2731dc7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63912
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Susanne Moog <look@susi.dev>
Reviewed-by: Susanne Moog <look@susi.dev>
  • Loading branch information
IchHabRecht authored and susannemoog committed Mar 25, 2020
1 parent 0c1c3d5 commit f1685c2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions typo3/sysext/install/Classes/Controller/UpgradeController.php
Expand Up @@ -24,6 +24,7 @@
use Symfony\Component\Finder\SplFileInfo;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Schema\Exception\StatementException;
use TYPO3\CMS\Core\FormProtection\FormProtectionFactory;
use TYPO3\CMS\Core\FormProtection\InstallToolFormProtection;
use TYPO3\CMS\Core\Http\JsonResponse;
Expand Down Expand Up @@ -883,9 +884,14 @@ public function upgradeWizardsBlockingDatabaseAddsAction(): ResponseInterface
// ext_localconf, db and ext_tables must be loaded for the updates :(
$this->loadExtLocalconfDatabaseAndExtTables();
$upgradeWizardsService = new UpgradeWizardsService();
$adds = $upgradeWizardsService->getBlockingDatabaseAdds();
$adds = [];
$needsUpdate = false;
if (!empty($adds)) {
try {
$adds = $upgradeWizardsService->getBlockingDatabaseAdds();
if (!empty($adds)) {
$needsUpdate = true;
}
} catch (StatementException $exception) {
$needsUpdate = true;
}
return new JsonResponse([
Expand Down

0 comments on commit f1685c2

Please sign in to comment.