Bug #96321
closedThe DatabaseQueryProcessor is not working when using "pidInList = root" with PHP 8.0
100%
Description
In ContentObjectRenderer::getQuery (line 6004) the $storagePid is compared to a number. $storagePid itself can be a number, 'this' or 'root'. When $storagePid is 'root' it will fail, because when using PHP 8.0 a string is not converted automatically to a number anymore.
There is a detailed description about it here:
https://www.php.net/manual/en/language.operators.comparison.php
»Warning: Prior to PHP 8.0.0, if a string is compared to a number or a numeric string then the string was converted to a number before performing the comparison.«
Updated by Wouter Wolters almost 3 years ago
- Subject changed from Errors with PHP 8.0 to The DatabaseQueryProcessor is not working when using "pidInList = root" with PHP 8.0
Updated by Torben Hansen almost 3 years ago
The problem is actually not the comparison of a string with an integer, but actually using the minus operator on a non numeric string, which throws an Unsupported operand types: string * int
exception.
$foo = -'typo3';
will throw the type error exception in PHP8, since the string is not numeric whereas $bar = -'3opyt';
only raises a warning, and the numeric string is interpreted as a 3
.
Updated by Gerrit Code Review almost 3 years ago
- Status changed from Accepted 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/+/72704
Updated by Gerrit Code Review almost 3 years 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/+/72704
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/+/72714
Updated by Torben Hansen almost 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b552afafd6be022c2a1bf2437d14ade8b50c2494.