Project

General

Profile

Actions

Bug #99200

closed

"Illegal offset type in isset or empty" on PHP8.1 when saving type "select", renderType = "selectCheckbox".

Added by Sascha Löffler about 2 years ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2022-11-25
Due date:
% Done:

100%

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

Description

PHP 8.1 throws an exception on saving a new entry with includes a field of type "select" and renderType = "selectCheckbox". (didn't test other renderTypes)

Exception is `Illegal offset type in isset or empty` in file web/typo3/sysext/backend/Classes/Utility/BackendUtility.php on Line 681.

It appears that $typeNum contains the array of the selected items if the element is new. If it is edited and saved, it includes a string with the values comma separated.

An array is apparaently not allowed in this isset() condition.

I am not sure why there is this difference if the element is new or edited. But it is already in this format when it arrives in the ServerRequest and as far as i have seen, it is never converted into a comma separated string in the dataHandler.

first checking if it is an array does fix the issue and the entry is correctly created in the database.


Files

Actions #1

Updated by Gerrit Code Review about 1 month 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/+/87419

Actions #2

Updated by Gerrit Code Review about 1 month ago

Patch set 2 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/+/87419

Actions #3

Updated by Gerrit Code Review about 1 month ago

Patch set 3 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/+/87419

Actions #4

Updated by Gerrit Code Review about 1 month ago

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

Actions #5

Updated by Gerrit Code Review about 1 month ago

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

Actions #6

Updated by Benni Mack about 1 month ago

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

Also available in: Atom PDF