Skip to content

Commit

Permalink
[BUGFIX] Only execute publish date update when fields exist
Browse files Browse the repository at this point in the history
Releases: master, 9.1, 9.0
  • Loading branch information
benjaminkott committed May 13, 2019
1 parent e99b34f commit 11210f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Classes/Install/Updates/DatabasePublishDateUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ public function executeUpdate(): bool
*/
public function updateNecessary(): bool
{
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('pages');
$tableColumns = $connection->getSchemaManager()->listTableColumns('pages');
if (!isset($tableColumns['publish_date'])) {
return false;
}

$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('pages');
$queryBuilder->getRestrictions()->removeAll();
Expand Down

0 comments on commit 11210f5

Please sign in to comment.