Issue Bug Closed

#98306PHP Warning: Undefined array key "tt_content_defValues"

Franz Holzinger 09/08/22, 20:18 updated 10/04/22, 08:54

Description

After creating a new extension by Extension Builder, the TYPO3 page module gives this error:

(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Undefined array key "tt_content_defValues." in /var/www/html/sources/typo3_src-11.5.14/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php line 373

NewContentElementController.php:

    protected function getWizardItem(array $itemConf): array
    {
        $itemConf['title'] = $this->getLanguageService()->sL($itemConf['title']);
        $itemConf['description'] = $this->getLanguageService()->sL($itemConf['description']);
        $itemConf['saveAndClose'] = (bool)($itemConf['saveAndClose'] ?? false);
        $itemConf['tt_content_defValues'] = $itemConf['tt_content_defValues.'];
        unset($itemConf['tt_content_defValues.']);
        return $itemConf;
    }

Bug fix:

$itemConf['tt_content_defValues'] = $itemConf['tt_content_defValues.'] ?? [];
(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Undefined array key "select_key" in /var/www/html/sources/typo3_src-11.5.14/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php line 429
if (is_array($GLOBALS['TCA']['tt_content']['columns'][$fN])) {

bugfix:

if (isset($GLOBALS['TCA']['tt_content']['columns'][$fN]) && is_array($GLOBALS['TCA']['tt_content']['columns'][$fN])) {

Reviews 1