Review main Merged

71944[BUGFIX] Fix PHP warnings in ext:lowlevel DB Check

Guido Schmechel CR +2 V +2 Normal +81 −82 updated 10/26/21, 21:31

Commit message

This prevents exceptions for missing array keys when using
the query generator for the DB Check backend module.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 2430

Show 45 earlier messages
  1. Guido Schmechel uploaded patch set 1 10/23/21, 13:29

  2. Guido Schmechel commented on patch set 1 10/23/21, 13:32

    QueryGenerator.php:381

    Here I am unsure if I need to check the array parent or just the child

    QueryGenerator.php:1729

    Here I am unsure if this is the right fallback. Feedback welcome :-)
  3. Guido Schmechel uploaded patch set 2 10/23/21, 13:34

  4. Guido Schmechel commented on patch set 1 10/23/21, 13:34

    QueryGenerator.php:381 Reply

    Done
  5. core-ci voted on patch set 1 V +1 10/23/21, 13:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18440

  1. core-ci voted on patch set 2 V +1 10/23/21, 13:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18441

  2. Stefan Bürk commented on patch set 2 CR -1 10/23/21, 14:44

    QueryGenerator.php:1463

    No need to introduce a local spaced variable here, as not used further anyway. Maybe simplify this with: ``` if (count($this->fields[$fieldName]['items'] ?? []) <= 1) { ```

    QueryGenerator.php:1729 Reply

    The empty $fieldType check here is okay. For the $conf['comparision'] I would go with a `?? 0` fallback instead of an isset check, as the isset would eventually not execute if fieldtype is test but comparision is "ommited". In generall here are some bit shiftings done to tranlsate beetween integer indexex and some values. See this for a visualization: https://3v4l.org/89BZ9

    QueryGenerator.php:1988

    Reuse '$allowedFields' here

    QueryGenerator.php:2057

    Weired substitution here - Using false as fallback will evaluate the first part of the condition as false, and as such not going into the if-then block. Orignal and second part of condition applies to go into it if condition is false. That's impossible and will never go into it again. Maybe use following as substitution ? ``` if (!($this->tableArray[$from_table] ?? false)) { ```
  3. Stefan Bürk commented on patch set 2 10/23/21, 14:45

    Little bit more description/context here ?
  4. Guido Schmechel uploaded patch set 3 10/23/21, 15:01

  5. Guido Schmechel commented on patch set 3 10/23/21, 15:05

    Thanks for your feedback. I have adopted your changes :-)

    QueryGenerator.php:1463 Reply

    Done

    QueryGenerator.php:1729 Reply

    Done

    QueryGenerator.php:1988 Reply

    Done

    QueryGenerator.php:2057 Reply

    Done
  6. core-ci voted on patch set 3 V +1 10/23/21, 15:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18444

  7. Guido Schmechel commented on patch set 3 10/23/21, 15:27

    Reply

    Done
  8. Stefan Bürk commented on patch set 3 CR -1 10/24/21, 12:12

    On it

    QueryGenerator.php:1727

    Rethought about this, and did not regonized it the first time. This would behave differently than before. Not sure if it is okay to change the behaviour here.

    QueryGenerator.php:1728

    verifyComparision says 'string' as type. But the code and everything does integer operations on it. Old shenanigans.

    QueryGenerator.php:1757

    no fallback for this ?

    QueryGenerator.php:1764

    Is this not the same code as in ~1725 ? Do we not have to do here the same ?
  9. Guido Schmechel commented on patch set 3 10/24/21, 12:20

    QueryGenerator.php:1757 Reply

    Didn't notice anything negative when testing in the backend. The whole class has many more hits in this area. We could, of course, make a local variable out of it, as there are directly 3 hits only in the Diff.

    QueryGenerator.php:1764 Reply

    Correct. See comment above
  10. Stefan Bürk uploaded patch set 4 10/24/21, 12:35

  11. Stefan Bürk commented on patch set 4 CR +1 10/24/21, 12:36

    QueryGenerator.php:1727 Reply

    Done

    QueryGenerator.php:1728 Reply

    Done

    QueryGenerator.php:1757 Reply

    Done

    QueryGenerator.php:1764 Reply

    Done
  12. core-ci voted on patch set 4 V +1 10/24/21, 12:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18496

  13. Jochen Roth voted on patch set 4 V +1 CR +1 10/25/21, 08:09

  14. Oliver Klee voted on patch set 4 CR +1 10/25/21, 10:15

  15. Nikita Hovratov uploaded patch set 5 10/26/21, 17:21

  16. Nikita Hovratov commented on patch set 5 10/26/21, 17:23

    Found some more places while testing.
  17. core-ci voted on patch set 5 V +1 10/26/21, 17:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18577

  18. Oliver Klee voted on patch set 5 CR +1 10/26/21, 20:58

  19. Christian Kuhn uploaded patch set 6 10/26/21, 21:08

  20. Christian Kuhn commented on patch set 6 V +1 CR +1 10/26/21, 21:09

    the entire module should be reconsidered and rewritten: there was a reason i moved that class to ext:lowlevel and out of ext:core in v11 ;)
  21. Stefan Bürk voted on patch set 6 V +1 CR +1 10/26/21, 21:10

  22. Oliver Klee voted on patch set 6 CR +1 10/26/21, 21:16

  23. core-ci voted on patch set 6 V +1 10/26/21, 21:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18600

  24. Christian Kuhn voted on patch set 6 V +2 CR +2 10/26/21, 21:31

  25. Christian Kuhn merged patch set 7 10/26/21, 21:31