Project

General

Profile

Actions

Bug #96873

closed

Undefined array key "exclude" in GridColumnItem.php

Added by Robert Vock almost 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2022-02-14
Due date:
% Done:

100%

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

Description

I've unset the exclude value for the tt_content hidden field, to allow editing by all user-groups without explicitly allowing the hidden field:

unset($GLOBALS['TCA']['tt_content']['columns']['hidden']['exclude']);

When I click the Page module, I get the following error:

PHP Warning: Undefined array key "exclude" in sysext/backend/Classes/View/BackendLayout/Grid/GridColumnItem.php line 305

The fix should be easy: Check, if the field is set or use ?? for a default value:
GridColumnItem.php#L305

As these bugs appear more often with PHP 8, it might be a good idea to ensure some array keys in TCA are always set. The TcaMigration class could ensure that exclude and the ctrl fields (like enablecolumns always exist in the array and are set to false or null to prevent "Undefined array key" warnings).

Actions #1

Updated by Gerrit Code Review almost 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73468

Actions #2

Updated by Gerrit Code Review almost 3 years ago

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/+/73397

Actions #3

Updated by Georg Ringer almost 3 years ago

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

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF