Commit cbb99a3b authored by Christian Kuhn's avatar Christian Kuhn Committed by Frank Nägler
Browse files

[BUGFIX] Silent upgrade wizard changes unrelated field definitions

The silent upgrade wizard that should add missing cache
database tables also tends to change fields of not related
tables. The good thing is that this silent upgrader is
not really needed anymore since the "check for missing fields"
step that is always executed afterwards does find and create
cache tables, too.

Resolves: #86228
Releases: master
Change-Id: I9747da74118a6af6368032aa63f6022e0f6c7514
Reviewed-on: https://review.typo3.org/58353


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
parent 8d4fe802
......@@ -68,7 +68,6 @@ class UpgradeWizardRunCommand extends Command
Bootstrap::initializeBackendAuthentication();
$this->upgradeWizardsService = new UpgradeWizardsService();
$this->upgradeWizardsService->isDatabaseCharsetUtf8() ?: $this->upgradeWizardsService->setDatabaseCharsetUtf8();
$this->upgradeWizardsService->silentCacheFrameworkTableSchemaMigration();
}
/**
......
......@@ -1043,30 +1043,6 @@ class UpgradeController extends AbstractController
]);
}
/**
* Execute silent database field adds like cache framework tables
*
* @return ResponseInterface
*/
public function upgradeWizardsSilentUpgradesAction(): ResponseInterface
{
$this->loadExtLocalconfDatabaseAndExtTables();
// Perform silent cache framework table upgrade
$upgradeWizardsService = new UpgradeWizardsService();
$statements = $upgradeWizardsService->silentCacheFrameworkTableSchemaMigration();
$messages = new FlashMessageQueue('install');
if (!empty($statements)) {
$messages->enqueue(new FlashMessage(
'',
'Created some database cache tables.'
));
}
return new JsonResponse([
'success' => true,
'status' => $messages,
]);
}
/**
* Initialize the core upgrade actions
*
......
......@@ -21,7 +21,6 @@ use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\Table;
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Output\StreamOutput;
use TYPO3\CMS\Core\Cache\DatabaseSchemaService;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Schema\SchemaMigrator;
use TYPO3\CMS\Core\Database\Schema\SqlReader;
......@@ -48,26 +47,6 @@ class UpgradeWizardsService
$this->output = new StreamOutput(fopen('php://temp', 'wb'), Output::VERBOSITY_NORMAL, false);
}
/**
* Force creation / update of caching framework tables that are needed by some update wizards
*
* @return array List of executed statements
*/
public function silentCacheFrameworkTableSchemaMigration(): array
{
$sqlReader = GeneralUtility::makeInstance(SqlReader::class);
$cachingFrameworkDatabaseSchemaService = GeneralUtility::makeInstance(DatabaseSchemaService::class);
$createTableStatements = $sqlReader->getStatementArray(
$cachingFrameworkDatabaseSchemaService->getCachingFrameworkRequiredDatabaseSchema()
);
$statements = [];
if (!empty($createTableStatements)) {
$schemaMigrationService = GeneralUtility::makeInstance(SchemaMigrator::class);
$statements = $schemaMigrationService->install($createTableStatements);
}
return $statements;
}
/**
* @return array List of wizards marked as done in registry
*/
......
......@@ -99,32 +99,6 @@ define([
success: function (data) {
if (data.success === true) {
modalContent.empty().append(data.html);
self.silentUpgrades();
} else {
Notification.error('Something went wrong');
}
},
error: function (xhr) {
Router.handleAjaxError(xhr);
}
});
},
silentUpgrades: function () {
var self = this;
var $outputContainer = this.currentModal.find(this.selectorOutputWizardsContainer);
$outputContainer.empty().html(this.renderProgressBar('Executing some silent upgrades...'));
$.ajax({
url: Router.getUrl('upgradeWizardsSilentUpgrades'),
cache: false,
success: function (data) {
if (data.success === true && Array.isArray(data.status)) {
if (data.status.length > 0) {
data.status.forEach((function (element) {
var message = InfoBox.render(element.severity, element.title, element.message);
$outputContainer.append(message);
}));
}
self.blockingUpgradesDatabaseCharsetTest();
} else {
Notification.error('Something went wrong');
......
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