Bug #99200
closed"Illegal offset type in isset or empty" on PHP8.1 when saving type "select", renderType = "selectCheckbox".
100%
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
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
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
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
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
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
Updated by Benni Mack about 1 month ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ac24ba415e7e4fb543d6bd30675ee826c66fe94d.