Project

General

Profile

Actions

Bug #98306

closed

PHP Warning: Undefined array key "tt_content_defValues"

Added by Franz Holzinger over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2022-09-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

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])) {

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #97201: Add new event to modify the new content element wizard itemsClosedOliver Bartsch2022-03-17

Actions
Actions #1

Updated by Andreas Kienast over 1 year 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.

Actions #2

Updated by Gerrit Code Review over 1 year 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

Actions #3

Updated by Andreas Fernandez over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Franz Holzinger over 1 year 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.

Actions #5

Updated by Simon Schaufelberger over 1 year ago

  • Description updated (diff)
Actions #6

Updated by Simon Schaufelberger over 1 year ago

  • Related to Feature #97201: Add new event to modify the new content element wizard items added
Actions #7

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF