Bug #98536
closedMany PHP Warnings in typo3/sysext/core/Classes/Database/QueryGenerator.php
100%
Description
For our client we're still using the QueryGenerator.php which is currently far away from PHP 8.1 compatibilty.
Or was.
I've tried to document all the warnings and changes.
But it does not make any sense.
In our environment the nwe & attached QueryGenerator works now with PHP 8.1
Here are some og the former warnings we've got:
After testing I've re-changed the [$fieldName]['type'] recognition again.
Attaches is a working version of the QueryGenerator.php which solves these issues:
PHP Warnings in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php
PHP Warning: Undefined array key "uid" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 296
PHP Warning: Undefined array key "exclude" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 298
PHP Warning: Undefined array key "items" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 322
PHP Warning: Undefined array key "special" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 337
PHP Warning: Undefined array key "inputValue1" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1384
PHP Warning: Undefined array key "inputValue1" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1386
PHP Warning: Undefined array key "inputValue1" in typo3_src/typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1391
PHP Warning: Undefined array key "deleted" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 569
PHP Warning: Undefined array key "negate" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 594
PHP Warning: Undefined array key "queryGroup" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1653
PHP Warning: Undefined array key "queryOrder" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1656
PHP Warning: Undefined array key "queryLimit" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1662
PHP Warning: Undefined array key "queryFields" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1453
PHP Warning: Undefined array key "queryGroup" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1456
PHP Warning: Undefined array key "queryOrder" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1459
PHP Warning: Undefined array key "queryLimit" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1463
PHP Warning: Undefined array key "queryLimit" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1466
PHP Warning: Undefined array key 1 in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1470
PHP Warning: Undefined array key "queryOrder" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1476
PHP Warning: Undefined array key "qG_del" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 447
PHP Warning: Undefined array key "qG_ins" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 465
PHP Warning: Undefined array key "165_" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1184
PHP Warning: Undefined array key "items" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 813
PHP Warning: Undefined array key "deleted" in /data/www/sites/baden-wuerttemberg.de/shared/typo3_src/typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 629
PHP Warning: Undefined array key "negate" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 765
PHP Warning: Undefined array key "sub" in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1026
PHP Warning: Undefined array key "dbint." in typo3_src-11.5.16/typo3/sysext/core/Classes/Database/QueryGenerator.php line 1508
I'm givig up to document all the changes necessary...
Files
Updated by Chris Müller about 2 years ago
The QueryGenerator has been deprecated in TYPO3 v11.0 and is removed with v12.0. Therefore, I assume, no bugfixes were made (and will mostly not be made) in this class for PHP8 compatibility.
Updated by Ralph Brugger about 2 years ago
I understand.
We're currently migrating a TYPO3 project from TYPO3 8 ELTS to TYPO3 11.5 and with PHP 8.1
We're using direct_mail which needs the QueryGenerator.
For the future we're planning to replace direct_mail with an own extension, but this will take some months.
Attached was a working version of the QueryGenerator.php which solves these PHP 8.1 issues for us at the moment.
Maybe this code could be used?
Ralph
Updated by Christian Kuhn almost 2 years ago
- Related to Bug #99511: Fix notices in QueryGenerator added
Updated by Christian Kuhn almost 2 years ago
- Status changed from New to Needs Feedback
Some are fixed with https://forge.typo3.org/issues/99511 now.
What is left? Would you like to test around on this again and see what is needed and maybe add a patch set, diff, or something? The line numbers are a bit hard to track since they tend to shift around with every change, and are different in main branch as well ...
Updated by Christian Kuhn almost 2 years ago
- Related to Bug #99568: Avoid undef array key in QueryGenerator added
Updated by Ralph Brugger over 1 year ago
- File QueryGenerator.php added
- File winmerge.patch added
Great. But there are many open.
I've taken the actual 11.5.24 and patched it again.
Attached the whole patched file + a patch created by winmerge
Updated by Ralph Brugger over 1 year ago
- File QueryGenerator.php QueryGenerator.php added
- File WinMerge.patch WinMerge.patch added
Next try:
Updated by JAKOTA Design Group GmbH over 1 year ago
Hi,
Can you check again with v11.5.25 please?
Your WinMerge.patch seems to be based of an older version.
Updated by Ralph Brugger over 1 year ago
- File WinMerge_11.5.25.patch WinMerge_11.5.25.patch added
patch for the 11.5.25
Updated by JAKOTA Design Group GmbH over 1 year ago
OK,
I now know where the confusion comes from.
All the recent patches were applied to
typo3/sysext/lowlevel/Classes/Database/QueryGenerator.php
but you are talking about
typo3/sysext/core/Classes/Database/QueryGenerator.php
This file was removed from main in v12.
I'll compare those two later or tomorrow and backport all the checks.
Updated by Ralph Brugger over 1 year ago
We have to keep the
typo3/sysext/core/Classes/Database/QueryGenerator.php alive
for some months until we're done with the replacement of direct_mail.
cute_mailing is our candidate at the moment.
Afterwards we can say goodbye to this piece of code:)
Updated by Gerrit Code Review over 1 year ago
- Status changed from Needs Feedback to Under Review
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/+/78139
Updated by Gerrit Code Review over 1 year ago
Patch set 2 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/+/78139
Updated by Ralph Brugger over 1 year ago
- File winmerge_3.patch winmerge_3.patch added
PHP Warning: Undefined array key 1 in QueryGenerator.php line 1456
PHP Warning: Undefined array key "sub" in QueryGenerator.php line 1011
Patch (or winmerge_3.patch)
1011c1011 < if (is_array($v['sub'])) { --- > if (isset($v['sub']) && is_array($v['sub'])) { 1456c1456 < if ($parts[1]) { --- > if (isset($parts[1]) && $parts[1]) {
Updated by Gerrit Code Review over 1 year ago
Patch set 3 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/+/78139
Updated by JAKOTA Design Group GmbH over 1 year ago
I wasn't done until now. :)
Please give this latest version a go.
Updated by Ralph Brugger over 1 year ago
Sorry:)
Will check it tomorrow morning!
Thanks a lot
Updated by JAKOTA Design Group GmbH over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 051cf2072e178466e354fc8b8250a810d82386b8.