Review 12.4 Merged

80169[BUGFIX] Properly bind parameters to statement in upgrade wizard

Elias Häußler CR +2 V +2 Easy +5 −2 updated 07/28/23, 18:26

Commit message

This patch fixes an issue with prepared statements in the sys_log
channel upgrade wizard. Values were bound incorrectly to the
underlying statement, because the parameter name was used for an
positional parameter. This is now fixed and all values are now
bound using the parameter's position.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • 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 1214

  1. Elias Häußler uploaded patch set 1 07/25/23, 14:11

  2. core-ci voted on patch set 1 V +1 07/25/23, 14:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44542

  3. Stefan Bürk commented on patch set 1 CR -1 07/25/23, 14:26

    SysLogChannel.php:60

    Please, don't revert to the deprecated doctrine/dbal api. However, you are correct - this drive-by change with https://review.typo3.org/c/Packages/TYPO3.CMS/+/79220 was wrong. Not tested, but I guess the correct way would be to have 2 bindValue() calls instead: ``` $statement->bind(0, $channel, Connection::PARAM_STR); $statement->bind(1, $type, Connection::PARAM_INT); ``` Same for the second change below.
  4. Stefan Bürk commented on patch set 1 07/25/23, 14:29

    SysLogChannel.php:60 Reply

    Change below "similar" not the same .. Correct here complete should be: ``` $statement->bind(0, $channel, Connection::PARAM_STR); $statement->bind(1, $type, Connection::PARAM_INT); $statement->executeStatement(); ```

    SysLogChannel.php:82

    Don't reverte to deprecated doctrine/dbal api please. The correct fix should be: ``` $statement->bind(0, $level, Connection::PARAM_STR); $statement->bind(1, $type, Connection::PARAM_INT); $statement->executeStatement(); ```
  5. Elias Häußler commented on patch set 1 07/25/23, 14:33

    SysLogChannel.php:60 Reply

    That's what I did first. However, it does not work either: > Uncaught TYPO3 Exception The number of elements in the type definition string must match the number of bind variables > thrown in file /var/www/html/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php > in line 196
  6. Elias Häußler commented on patch set 1 07/25/23, 14:42

    SysLogChannel.php:60 Reply

    Ah, I see, it starts counting from 1. Will update the patch accordingly.
  7. Stefan Bürk commented on patch set 1 07/25/23, 14:43

    SysLogChannel.php:60 Reply

    ah yes .. sry .. not looked up again. was just out of mind.
  8. Elias Häußler uploaded patch set 2 CR -1 V +1 07/25/23, 14:47

  9. Elias Häußler commented on patch set 2 07/25/23, 14:48

    SysLogChannel.php:60 Reply

    Done

    SysLogChannel.php:82 Reply

    Done
  10. core-ci voted on patch set 2 V +1 07/25/23, 14:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44543

  11. Stefan Bürk voted on patch set 2 V +1 CR +1 07/25/23, 20:03

  12. Stefan Bürk commented on patch set 2 07/25/23, 20:05

    broke in v12 only, main upgrade wizard have been already remove due to policy. v11 has working state.
  13. Christian Kuhn voted on patch set 2 V +2 CR +2 07/28/23, 18:26

  14. Christian Kuhn merged patch set 3 07/28/23, 18:26