From 5b5336f689fdff4eed489d069ed69e1756e600dc Mon Sep 17 00:00:00 2001
From: Tymoteusz Motylewski <t.motylewski@gmail.com>
Date: Mon, 6 Nov 2017 09:12:26 +0100
Subject: [PATCH] [BUGFIX] Fix some PHP Notices thrown when rendering page
 module

Resolves: #82921
Releases: master, 8.7
Change-Id: Id26239e65321aa3653de849932a0be7e626bd653
Reviewed-on: https://review.typo3.org/54558
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
---
 .../Controller/PageLayoutController.php       |  4 +-
 .../backend/Classes/Module/ModuleLoader.php   | 14 ++++---
 .../Classes/Template/ModuleTemplate.php       |  4 +-
 .../Classes/Utility/BackendUtility.php        | 38 ++++++++++++-------
 .../AbstractUserAuthentication.php            |  2 +-
 typo3/sysext/core/Classes/Log/LogManager.php  |  2 +-
 .../Backend/DatabaseSessionBackend.php        |  2 +-
 .../Classes/TypoScript/TemplateService.php    | 17 ++++++---
 .../Utility/ExtensionManagementUtility.php    | 13 ++++---
 .../core/Classes/Utility/GeneralUtility.php   |  2 +-
 .../Classes/Utility/ExtensionUtility.php      |  2 +-
 .../Classes/Utility/LocalizationUtility.php   |  2 +-
 .../TCA/Overrides/tt_content.php              |  6 +--
 13 files changed, 65 insertions(+), 43 deletions(-)

diff --git a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php
index 7c7b6560c5f3..07afbaeb2a7f 100644
--- a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php
+++ b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php
@@ -991,14 +991,14 @@ class PageLayoutController
         $this->buttonBar->addButton($shortcutButton);
 
         // Cache
-        if (!$this->modTSconfig['properties']['disableAdvanced']) {
+        if (empty($this->modTSconfig['properties']['disableAdvanced'])) {
             $clearCacheButton = $this->buttonBar->makeLinkButton()
                 ->setHref(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->pageinfo['uid'], 'clear_cache' => '1']))
                 ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.clear_cache'))
                 ->setIcon($this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL));
             $this->buttonBar->addButton($clearCacheButton, ButtonBar::BUTTON_POSITION_RIGHT, 1);
         }
-        if (!$this->modTSconfig['properties']['disableIconToolbar']) {
+        if (empty($this->modTSconfig['properties']['disableIconToolbar'])) {
             // Edit page properties and page language overlay icons
             if ($this->pageIsNotLockedForEditors() && $this->getBackendUser()->checkLanguageAccess(0)) {
                 // Edit localized pages only when one specific language is selected
diff --git a/typo3/sysext/backend/Classes/Module/ModuleLoader.php b/typo3/sysext/backend/Classes/Module/ModuleLoader.php
index e742979ca2ba..aec015687cc5 100644
--- a/typo3/sysext/backend/Classes/Module/ModuleLoader.php
+++ b/typo3/sysext/backend/Classes/Module/ModuleLoader.php
@@ -139,7 +139,7 @@ class ModuleLoader
     public function checkMod($name)
     {
         // Check for own way of configuring module
-        if (is_array($GLOBALS['TBE_MODULES']['_configuration'][$name]['configureModuleFunction'])) {
+        if (is_array($GLOBALS['TBE_MODULES']['_configuration'][$name]['configureModuleFunction'] ?? false)) {
             trigger_error('Registering a module using "configureModuleFunction" is deprecated and will be removed in TYPO3 v10.', E_USER_DEPRECATED);
             $obj = $GLOBALS['TBE_MODULES']['_configuration'][$name]['configureModuleFunction'];
             if (is_callable($obj)) {
@@ -159,14 +159,13 @@ class ModuleLoader
         if (empty($setupInformation['configuration'])) {
             return 'notFound';
         }
-        if (
-            $setupInformation['configuration']['shy']
+        $finalModuleConfiguration = $setupInformation['configuration'];
+        if (!empty($finalModuleConfiguration['shy'])
             || !$this->checkModAccess($name, $setupInformation['configuration'])
             || !$this->checkModWorkspace($name, $setupInformation['configuration'])
         ) {
             return false;
         }
-        $finalModuleConfiguration = $setupInformation['configuration'];
         $finalModuleConfiguration['name'] = $name;
         // Language processing. This will add module labels and image reference to the internal ->moduleLabels array of the LANG object.
         $this->addLabelsForModule($name, ($finalModuleConfiguration['labels'] ?? $setupInformation['labels']));
@@ -193,9 +192,12 @@ class ModuleLoader
         }
 
         // check if there is a navigation component (like the pagetree)
-        if (is_array($this->navigationComponents[$name])) {
+        if (is_array($this->navigationComponents[$name] ?? false)) {
             $finalModuleConfiguration['navigationComponentId'] = $this->navigationComponents[$name]['componentId'];
-        } elseif ($mainModule && is_array($this->navigationComponents[$mainModule]) && $setupInformation['configuration']['inheritNavigationComponentFromMainModule'] !== false) {
+        } elseif ($mainModule
+            && is_array($this->navigationComponents[$mainModule] ?? false)
+            && $setupInformation['configuration']['inheritNavigationComponentFromMainModule'] !== false) {
+
             // navigation component can be overridden by the main module component
             $finalModuleConfiguration['navigationComponentId'] = $this->navigationComponents[$mainModule]['componentId'];
         }
diff --git a/typo3/sysext/backend/Classes/Template/ModuleTemplate.php b/typo3/sysext/backend/Classes/Template/ModuleTemplate.php
index ffda419c3725..6d1e5edbacb9 100644
--- a/typo3/sysext/backend/Classes/Template/ModuleTemplate.php
+++ b/typo3/sysext/backend/Classes/Template/ModuleTemplate.php
@@ -270,10 +270,10 @@ class ModuleTemplate
      */
     protected function loadStylesheets()
     {
-        if ($GLOBALS['TBE_STYLES']['stylesheet']) {
+        if (!empty($GLOBALS['TBE_STYLES']['stylesheet'])) {
             $this->pageRenderer->addCssFile($GLOBALS['TBE_STYLES']['stylesheet']);
         }
-        if ($GLOBALS['TBE_STYLES']['stylesheet2']) {
+        if (!empty($GLOBALS['TBE_STYLES']['stylesheet2'])) {
             $this->pageRenderer->addCssFile($GLOBALS['TBE_STYLES']['stylesheet2']);
         }
     }
diff --git a/typo3/sysext/backend/Classes/Utility/BackendUtility.php b/typo3/sysext/backend/Classes/Utility/BackendUtility.php
index 161fe78e6811..6b1f3b4f51a2 100644
--- a/typo3/sysext/backend/Classes/Utility/BackendUtility.php
+++ b/typo3/sysext/backend/Classes/Utility/BackendUtility.php
@@ -362,7 +362,7 @@ class BackendUtility
         $output = [];
         $pid = $uid;
         $ident = $pid . '-' . $clause . '-' . $workspaceOL . ($additionalFields ? '-' . implode(',', $additionalFields) : '');
-        if (is_array($BEgetRootLine_cache[$ident])) {
+        if (is_array($BEgetRootLine_cache[$ident] ?? false)) {
             $output = $BEgetRootLine_cache[$ident];
         } else {
             $loopCheck = 100;
@@ -378,7 +378,20 @@ class BackendUtility
                 }
             }
             if ($uid == 0) {
-                $theRowArray[] = ['uid' => 0, 'title' => ''];
+                $theRowArray[] = [
+                    'uid' => 0,
+                    'pid' => null,
+                    'title' => '',
+                    'doktype' => null,
+                    'tsconfig_includes' => null,
+                    'TSconfig' => null,
+                    'is_siteroot' => null,
+                    't3ver_oid' => null,
+                    't3ver_wsid' => null,
+                    't3ver_state' => null,
+                    't3ver_stage' => null,
+                    'backend_layout_next_level' => null
+                ];
             }
             $c = count($theRowArray);
             foreach ($theRowArray as $val) {
@@ -422,7 +435,7 @@ class BackendUtility
     {
         static $getPageForRootline_cache = [];
         $ident = $uid . '-' . $clause . '-' . $workspaceOL;
-        if (is_array($getPageForRootline_cache[$ident])) {
+        if (is_array($getPageForRootline_cache[$ident]) ?? false) {
             $row = $getPageForRootline_cache[$ident];
         } else {
             $queryBuilder = static::getQueryBuilderForTable('pages');
@@ -846,7 +859,7 @@ class BackendUtility
         }
         $cacheHash = $res['hash'];
         // Get User TSconfig overlay
-        $userTSconfig = static::getBackendUserAuthentication()->userTS['page.'];
+        $userTSconfig = static::getBackendUserAuthentication()->userTS['page.'] ?? null;
         if (is_array($userTSconfig)) {
             ArrayUtility::mergeRecursiveWithOverrule($tsConfig, $userTSconfig);
             $cacheHash .= '_user' . static::getBackendUserAuthentication()->user['uid'];
@@ -1587,10 +1600,7 @@ class BackendUtility
     public static function getLabelFromItemlist($table, $col, $key)
     {
         // Check, if there is an "items" array:
-        if (is_array($GLOBALS['TCA'][$table])
-            && is_array($GLOBALS['TCA'][$table]['columns'][$col])
-            && is_array($GLOBALS['TCA'][$table]['columns'][$col]['config']['items'])
-        ) {
+        if (is_array($GLOBALS['TCA'][$table]['columns'][$col]['config']['items'] ?? false)) {
             // Traverse the items-array...
             foreach ($GLOBALS['TCA'][$table]['columns'][$col]['config']['items'] as $v) {
                 // ... and return the first found label where the value was equal to $key
@@ -1722,7 +1732,7 @@ class BackendUtility
         $recordTitle = '';
         if (is_array($GLOBALS['TCA'][$table])) {
             // If configured, call userFunc
-            if ($GLOBALS['TCA'][$table]['ctrl']['label_userFunc']) {
+            if (!empty($GLOBALS['TCA'][$table]['ctrl']['label_userFunc'])) {
                 $params['table'] = $table;
                 $params['row'] = $row;
                 $params['title'] = '';
@@ -1744,8 +1754,8 @@ class BackendUtility
                     $row['uid'],
                     $forceResult
                 );
-                if ($GLOBALS['TCA'][$table]['ctrl']['label_alt']
-                    && ($GLOBALS['TCA'][$table]['ctrl']['label_alt_force'] || (string)$recordTitle === '')
+                if (!empty($GLOBALS['TCA'][$table]['ctrl']['label_alt'])
+                    && (!empty($GLOBALS['TCA'][$table]['ctrl']['label_alt_force']) || (string)$recordTitle === '')
                 ) {
                     $altFields = GeneralUtility::trimExplode(',', $GLOBALS['TCA'][$table]['ctrl']['label_alt'], true);
                     $tA = [];
@@ -1879,7 +1889,7 @@ class BackendUtility
                 break;
             case 'inline':
             case 'select':
-                if ($theColConf['MM']) {
+                if (!empty($theColConf['MM'])) {
                     if ($uid) {
                         // Display the title of MM related records in lists
                         if ($noRecordLookup) {
@@ -1955,7 +1965,7 @@ class BackendUtility
                         }
                     }
                     $l = self::getLabelsFromItemsList($table, $col, $value, $columnTsConfig);
-                    if ($theColConf['foreign_table'] && !$l && $GLOBALS['TCA'][$theColConf['foreign_table']]) {
+                    if (!empty($theColConf['foreign_table']) && !$l && !empty($GLOBALS['TCA'][$theColConf['foreign_table']])) {
                         if ($noRecordLookup) {
                             $l = $value;
                         } else {
@@ -2206,7 +2216,7 @@ class BackendUtility
                 }
         }
         // If this field is a password field, then hide the password by changing it to a random number of asterisk (*)
-        if (stristr($theColConf['eval'], 'password')) {
+        if (!empty($theColConf['eval']) && stristr($theColConf['eval'], 'password')) {
             $l = '';
             $randomNumber = rand(5, 12);
             for ($i = 0; $i < $randomNumber; $i++) {
diff --git a/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php b/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php
index 37ce4898fc46..062807dd86a0 100644
--- a/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php
+++ b/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php
@@ -377,7 +377,7 @@ abstract class AbstractUserAuthentication implements LoggerAwareInterface
         $this->newSessionID = false;
         // $id is set to ses_id if cookie is present. Else set to FALSE, which will start a new session
         $id = $this->getCookie($this->name);
-        $this->svConfig = $GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth'];
+        $this->svConfig = $GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth'] ?? [];
 
         // If fallback to get mode....
         if (!$id && $this->getFallBack && $this->get_name) {
diff --git a/typo3/sysext/core/Classes/Log/LogManager.php b/typo3/sysext/core/Classes/Log/LogManager.php
index 4679e4265c86..60f12155e1b5 100644
--- a/typo3/sysext/core/Classes/Log/LogManager.php
+++ b/typo3/sysext/core/Classes/Log/LogManager.php
@@ -179,7 +179,7 @@ class LogManager implements \TYPO3\CMS\Core\SingletonInterface, LogManagerInterf
         // for these keys, for example "writerConfiguration"
         $configurationKey = $configurationType . 'Configuration';
         $configuration = $GLOBALS['TYPO3_CONF_VARS']['LOG'];
-        $result = $configuration[$configurationKey] ?: [];
+        $result = $configuration[$configurationKey] ?? [];
         // Walk from general to special (t3lib, t3lib.db, t3lib.db.foo)
         // and search for the most specific configuration
         foreach ($explodedName as $partOfClassName) {
diff --git a/typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php b/typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php
index ca733092c6a4..2917ef918f65 100644
--- a/typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php
+++ b/typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php
@@ -51,7 +51,7 @@ class DatabaseSessionBackend implements SessionBackendInterface
      */
     public function initialize(string $identifier, array $configuration)
     {
-        $this->hasAnonymousSessions = (bool)$configuration['has_anonymous'];
+        $this->hasAnonymousSessions = (bool)($configuration['has_anonymous'] ?? false);
         $this->configuration = $configuration;
     }
 
diff --git a/typo3/sysext/core/Classes/TypoScript/TemplateService.php b/typo3/sysext/core/Classes/TypoScript/TemplateService.php
index 2989a73ebc3d..3f330b6c979b 100644
--- a/typo3/sysext/core/Classes/TypoScript/TemplateService.php
+++ b/typo3/sysext/core/Classes/TypoScript/TemplateService.php
@@ -947,20 +947,27 @@ class TemplateService
 
         // @todo Change to use new API
         foreach ($GLOBALS['TYPO3_LOADED_EXT'] as $extKey => $files) {
-            if ((is_array($files) || $files instanceof \ArrayAccess) && ($files['ext_typoscript_constants.txt'] || $files['ext_typoscript_constants.typoscript'] || $files['ext_typoscript_setup.txt'] || $files['ext_typoscript_setup.typoscript'])) {
+            if ((is_array($files) || $files instanceof \ArrayAccess)
+                && (
+                    !empty($files['ext_typoscript_constants.txt'])
+                    || !empty($files['ext_typoscript_constants.typoscript'])
+                    || !empty($files['ext_typoscript_setup.txt'])
+                    || !empty($files['ext_typoscript_setup.typoscript'])
+                )
+            ) {
                 $mExtKey = str_replace('_', '', $extKey);
                 $constants = '';
                 $config = '';
 
-                if ($files['ext_typoscript_constants.typoscript']) {
+                if (!empty($files['ext_typoscript_constants.typoscript'])) {
                     $constants = @file_get_contents($files['ext_typoscript_constants.typoscript']);
-                } elseif ($files['ext_typoscript_constants.txt']) {
+                } elseif (!empty($files['ext_typoscript_constants.txt'])) {
                     $constants = @file_get_contents($files['ext_typoscript_constants.txt']);
                 }
 
-                if ($files['ext_typoscript_setup.typoscript']) {
+                if (!empty($files['ext_typoscript_setup.typoscript'])) {
                     $config = @file_get_contents($files['ext_typoscript_setup.typoscript']);
-                } elseif ($files['ext_typoscript_setup.txt']) {
+                } elseif (!empty($files['ext_typoscript_setup.txt'])) {
                     $config = @file_get_contents($files['ext_typoscript_setup.txt']);
                 }
 
diff --git a/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php b/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
index 49ea69eabf66..f41e83f8e662 100644
--- a/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
+++ b/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
@@ -294,7 +294,7 @@ class ExtensionManagementUtility
 
             $fieldExists = false;
             $newPosition = '';
-            if (is_array($GLOBALS['TCA'][$table]['palettes'])) {
+            if (is_array($GLOBALS['TCA'][$table]['palettes'] ?? false)) {
                 // Get the palette names used in current showitem
                 $paletteCount = preg_match_all('/(?:^|,)                    # Line start or a comma
 					(?:
@@ -305,6 +305,9 @@ class ExtensionManagementUtility
                     $paletteNames = array_filter(array_merge($paletteMatches[1], $paletteMatches[2]));
                     if (!empty($paletteNames)) {
                         foreach ($paletteNames as $paletteName) {
+                            if (!isset($GLOBALS['TCA'][$table]['palettes'][$paletteName])) {
+                                continue;
+                            }
                             $palette = $GLOBALS['TCA'][$table]['palettes'][$paletteName];
                             switch ($positionIdentifier) {
                                 case 'after':
@@ -901,9 +904,9 @@ class ExtensionManagementUtility
         $options = [
             'module' => true,
             'moduleName' => $fullModuleSignature,
-            'access' => $moduleConfiguration['access'] ?: 'user,group'
+            'access' => !empty($moduleConfiguration['access']) ? $moduleConfiguration['access'] : 'user,group'
         ];
-        if ($moduleConfiguration['routeTarget']) {
+        if (!empty($moduleConfiguration['routeTarget'])) {
             $options['target'] = $moduleConfiguration['routeTarget'];
         }
 
@@ -979,10 +982,10 @@ class ExtensionManagementUtility
         if (empty($key)) {
             throw new \RuntimeException('No extension key set in addLLrefForTCAdescr(). Provide it as third parameter', 1507321596);
         }
-        if (!is_array($GLOBALS['TCA_DESCR'][$key])) {
+        if (!is_array($GLOBALS['TCA_DESCR'][$key] ?? false)) {
             $GLOBALS['TCA_DESCR'][$key] = [];
         }
-        if (!is_array($GLOBALS['TCA_DESCR'][$key]['refs'])) {
+        if (!is_array($GLOBALS['TCA_DESCR'][$key]['refs'] ?? false)) {
             $GLOBALS['TCA_DESCR'][$key]['refs'] = [];
         }
         $GLOBALS['TCA_DESCR'][$key]['refs'][] = $file;
diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php
index ac6669255f07..71cd8d455a80 100644
--- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php
+++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php
@@ -1641,7 +1641,7 @@ class GeneralUtility
             // Closing tag.
             $tagName = $tagName[0] === 'n' && MathUtility::canBeInterpretedAsInteger($testNtag) ? (int)$testNtag : $tagName;
             // Test for alternative index value:
-            if ((string)$val['attributes']['index'] !== '') {
+            if ((string)($val['attributes']['index'] ?? '') !== '') {
                 $tagName = $val['attributes']['index'];
             }
             // Setting tag-values, manage stack:
diff --git a/typo3/sysext/extbase/Classes/Utility/ExtensionUtility.php b/typo3/sysext/extbase/Classes/Utility/ExtensionUtility.php
index 5ecadfd807a4..85ab703c90cf 100644
--- a/typo3/sysext/extbase/Classes/Utility/ExtensionUtility.php
+++ b/typo3/sysext/extbase/Classes/Utility/ExtensionUtility.php
@@ -59,7 +59,7 @@ class ExtensionUtility
         $extensionName = str_replace(' ', '', ucwords(str_replace('_', ' ', $extensionName)));
 
         $pluginSignature = strtolower($extensionName . '_' . $pluginName);
-        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName])) {
+        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName] ?? false)) {
             $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName] = [];
         }
         foreach ($controllerActions as $controllerName => $actionsList) {
diff --git a/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php b/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php
index 404dd911bbe7..badf8a6a2883 100644
--- a/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php
+++ b/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php
@@ -220,7 +220,7 @@ class LocalizationUtility
     {
         $configurationManager = static::getConfigurationManager();
         $frameworkConfiguration = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, $extensionName);
-        if (!is_array($frameworkConfiguration['_LOCAL_LANG'])) {
+        if (!is_array($frameworkConfiguration['_LOCAL_LANG'] ?? false)) {
             return;
         }
         self::$LOCAL_LANG_UNSET[$languageFilePath] = [];
diff --git a/typo3/sysext/t3editor/Configuration/TCA/Overrides/tt_content.php b/typo3/sysext/t3editor/Configuration/TCA/Overrides/tt_content.php
index 12382874376e..263f0dad1a34 100644
--- a/typo3/sysext/t3editor/Configuration/TCA/Overrides/tt_content.php
+++ b/typo3/sysext/t3editor/Configuration/TCA/Overrides/tt_content.php
@@ -3,13 +3,13 @@ defined('TYPO3_MODE') or die();
 
 // Activate t3editor for tt_content type HTML if this type exists
 if (is_array($GLOBALS['TCA']['tt_content']['types']['html'])) {
-    if (!is_array($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides'])) {
+    if (!isset($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides'])) {
         $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides'] = [];
     }
-    if (!is_array($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext'])) {
+    if (!isset($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext'])) {
         $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext'] = [];
     }
-    if (!is_array($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config'])) {
+    if (!isset($GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config'])) {
         $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config'] = [];
     }
     $GLOBALS['TCA']['tt_content']['types']['html']['columnsOverrides']['bodytext']['config']['renderType'] = 't3editor';
-- 
GitLab