Bug #98306
closedPHP Warning: Undefined array key "tt_content_defValues"
100%
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])) {
Updated by Andreas Kienast about 2 years ago
The first one is valid and also fixed in main this way. The second issue (line 429) looks invalid and indicates a misconfiguration in your PageTS as you try to access a column that doesn't exist.
Updated by Gerrit Code Review about 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75670
Updated by Andreas Fernandez about 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 91d81bde8aa2216a553d70a27f49820ee9df0cf1.
Updated by Franz Holzinger about 2 years ago
Andreas Fernandez:
"The second issue (line 429) looks invalid and indicates a misconfiguration in your PageTS as you try to access a column that doesn't exist."
What do you mean?
I have found this:
=========================================================== Deprecation: #77934 - Deprecate tt_content field select_key ===========================================================
https://docs.typo3.org/c/typo3/cms-core/11.5/en-us/Changelog/8.6/Breaking-77934-RemoveSelectKeyFromContentElementPreview.html?highlight=select_key
Affected Installations ======================
All installations and extensions using the field `select_key` of the table `tt_content`.
TYPO3 must check if this column does not exist. It is not acceptable that TYPO3 produces a warning or throws an exception.
Updated by Simon Schaufelberger about 2 years ago
- Related to Feature #97201: Add new event to modify the new content element wizard items added