From e99b34f9e02d2326e36310b6177f6df5f2054ab5 Mon Sep 17 00:00:00 2001 From: Benjamin Kott Date: Tue, 14 May 2019 00:35:30 +0200 Subject: [PATCH] [BUGFIX] Only execute month and year update when fields exist Releases: master, 9.1, 9.0, 8.7 --- Classes/Install/Updates/DatabaseMonthYearUpdate.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Classes/Install/Updates/DatabaseMonthYearUpdate.php b/Classes/Install/Updates/DatabaseMonthYearUpdate.php index c07bba76..f1a6e049 100644 --- a/Classes/Install/Updates/DatabaseMonthYearUpdate.php +++ b/Classes/Install/Updates/DatabaseMonthYearUpdate.php @@ -120,6 +120,12 @@ public function executeUpdate(): bool */ public function updateNecessary(): bool { + $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('pages'); + $tableColumns = $connection->getSchemaManager()->listTableColumns('pages'); + if (!isset($tableColumns['crdate_month']) && !isset($tableColumns['crdate_year'])) { + return false; + } + $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('pages'); $queryBuilder->getRestrictions()->removeAll();