Commit c967c997 authored by Nicole Cordes's avatar Nicole Cordes Committed by Susanne Moog
Browse files

[BUGFIX] Catch error in database Upgrade Wizard

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/+/59182


Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: Susanne Moog's avatarSusanne Moog <look@susi.dev>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Susanne Moog's avatarSusanne Moog <look@susi.dev>
parent 06188d7f
......@@ -24,6 +24,7 @@ use Symfony\Component\Finder\Finder;
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;
......@@ -940,10 +941,15 @@ class UpgradeController extends AbstractController
// ext_localconf, db and ext_tables must be loaded for the updates :(
$this->loadExtLocalconfDatabaseAndExtTables(false);
$upgradeWizardsService = new UpgradeWizardsService();
$adds = $upgradeWizardsService->getBlockingDatabaseAdds();
$this->resetGlobalContainer();
$adds = [];
$needsUpdate = false;
if (!empty($adds)) {
try {
$adds = $upgradeWizardsService->getBlockingDatabaseAdds();
$this->resetGlobalContainer();
if (!empty($adds)) {
$needsUpdate = true;
}
} catch (StatementException $exception) {
$needsUpdate = true;
}
return new JsonResponse([
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment