[BUGFIX] Upgrade Wizard "Split menu types.." fails
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / Classes / Updates / SplitMenusUpdate.php
index 1813bd2..6a11527 100644 (file)
@@ -39,6 +39,12 @@ class SplitMenusUpdate extends AbstractUpdate
         if ($this->isWizardDone()) {
             return false;
         }
+        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content');
+        $tableColumns = $connection->getSchemaManager()->listTableColumns('tt_content');
+        // Only proceed if menu_type field still exists
+        if (!isset($tableColumns['menu_type'])) {
+            return false;
+        }
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
         $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
         $elementCount = $queryBuilder->count('uid')