Skip to content

Commit

Permalink
[BUGFIX] Only execute month and year update when fields exist
Browse files Browse the repository at this point in the history
Releases: master, 9.1, 9.0, 8.7
  • Loading branch information
benjaminkott committed May 13, 2019
1 parent 5326fac commit e99b34f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Classes/Install/Updates/DatabaseMonthYearUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e99b34f

Please sign in to comment.