Project

General

Profile

Actions

Bug #96321

closed

The DatabaseQueryProcessor is not working when using "pidInList = root" with PHP 8.0

Added by Benni Mack over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Start date:
2021-12-10
Due date:
% Done:

100%

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

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.«

Actions #1

Updated by Wouter Wolters over 2 years ago

  • Subject changed from Errors with PHP 8.0 to The DatabaseQueryProcessor is not working when using "pidInList = root" with PHP 8.0
Actions #2

Updated by Wouter Wolters over 2 years ago

  • Description updated (diff)
Actions #3

Updated by Georg Ringer over 2 years ago

  • Status changed from New to Accepted
Actions #4

Updated by Malte Riechmann over 2 years ago

  • PHP Version set to 8.0
Actions #5

Updated by Torben Hansen over 2 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.

Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

Updated by Torben Hansen over 2 years ago

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

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF