Project

General

Profile

Actions

Bug #98536

closed

Many PHP Warnings in typo3/sysext/core/Classes/Database/QueryGenerator.php

Added by Ralph Brugger over 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2022-10-05
Due date:
% Done:

100%

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

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

QueryGenerator.php (74.2 KB) QueryGenerator.php Ralph Brugger, 2022-10-05 09:18
WinMerge.patch (20.5 KB) WinMerge.patch Ralph Brugger, 2023-03-16 07:27
QueryGenerator.php (74.4 KB) QueryGenerator.php Ralph Brugger, 2023-03-16 07:27
WinMerge_11.5.25.patch (20.5 KB) WinMerge_11.5.25.patch Ralph Brugger, 2023-03-16 11:10
winmerge_3.patch (220 Bytes) winmerge_3.patch Ralph Brugger, 2023-03-16 20:48

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #99511: Fix notices in QueryGeneratorClosedGeorg Ringer2023-01-11

Actions
Related to TYPO3 Core - Bug #99568: Avoid undef array key in QueryGeneratorClosed2023-01-17

Actions
Actions #1

Updated by Chris Müller over 1 year 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.

See also: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.0/Deprecation-92080-DeprecatedQueryGeneratorAndQueryView.html

Actions #2

Updated by Ralph Brugger over 1 year 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

Actions #3

Updated by Christian Kuhn over 1 year ago

  • Related to Bug #99511: Fix notices in QueryGenerator added
Actions #4

Updated by Christian Kuhn over 1 year 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 ...

Actions #5

Updated by Christian Kuhn over 1 year ago

  • Related to Bug #99568: Avoid undef array key in QueryGenerator added
Actions #6

Updated by Ralph Brugger about 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

Actions #7

Updated by Ralph Brugger about 1 year ago

  • File deleted (QueryGenerator.php)
Actions #8

Updated by Ralph Brugger about 1 year ago

  • File deleted (winmerge.patch)
Actions #10

Updated by JAKOTA Design Group GmbH about 1 year ago

Hi,

Can you check again with v11.5.25 please?

Your WinMerge.patch seems to be based of an older version.

Actions #11

Updated by Ralph Brugger about 1 year ago

patch for the 11.5.25

Actions #12

Updated by JAKOTA Design Group GmbH about 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.

Actions #13

Updated by Ralph Brugger about 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:)

Actions #14

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

Actions #15

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

Actions #16

Updated by Ralph Brugger about 1 year ago

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]) {

Actions #17

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

Actions #18

Updated by JAKOTA Design Group GmbH about 1 year ago

I wasn't done until now. :)

Please give this latest version a go.

Actions #19

Updated by Ralph Brugger about 1 year ago

Sorry:)

Will check it tomorrow morning!

Thanks a lot

Actions #20

Updated by JAKOTA Design Group GmbH about 1 year ago

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

Also available in: Atom PDF