Review main Merged

71449[BUGFIX] Add parenthesis where operation result is enforced

Nikita Hovratov CR +2 V +2 Easy +7 −7 updated 05/04/22, 16:11

Commit message

The coalesce operator has a relatively low precedence over other
operators. If used as part of other expressions, it is almost always
necessary to wrap it in parenthesis. Otherwise unexpected behaviour or
undefined array key errors (in PHP 8.0) may occur.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Benjamin Franzke +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Benjamin Franzke +1
    • core-ci +1 CI

Issues 1

Files 6

Review log 1011

  1. Nikita Hovratov uploaded patch set 1 10/05/21, 20:22

  2. core-ci voted on patch set 1 V +1 10/05/21, 20:40 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17635

  3. Benjamin Franzke voted on patch set 1 CR +1 10/06/21, 03:11

  4. Benjamin Franzke voted on patch set 1 V +1 10/06/21, 03:39

  5. Oli Bartsch commented on patch set 1 10/08/21, 22:07

    Typo3DbBackend.php:503

    Couldn't we just use $languageOfCurrentRecord = $row[$GLOBALS['TCA'][$tableName]['ctrl']['languageField'] ?? null] ?? 0 and skip the if block?

    ContentObjectRenderer.php:3425

    This is already fixed. (See #95489)
  6. Oli Bartsch commented on patch set 1 V +2 CR +2 10/08/21, 22:11

    Typo3DbBackend.php:503 Reply

    Done

    ContentObjectRenderer.php:3425 Reply

    Done
  7. Oli Bartsch merged patch set 2 10/08/21, 22:11

  8. Oliver Hader commented on patch set 2 05/04/22, 06:42

    What about back-porting this to 10.4 branch (as mentioned in `Releases:`)?
  9. Oli Bartsch commented on patch set 2 05/04/22, 14:01

    Reply

    Unfortunately this backport was forgotten. We noticed it when 10.4 was already in priority bugfix mode and we therefore decided to not do the backport anymore.
  10. Oliver Klee commented on patch set 2 05/04/22, 14:06

    Reply

    Should/can we backport this to 11.5?
  11. Oliver Hader commented on patch set 2 05/04/22, 16:11

    Reply

    It is part of v11.5.1 - at that time the branch for `11.5` did not exist yet. I've excluded the back-port now at https://forger.typo3.com/utilities/backport/list