Review main Merged

72138[BUGFIX] Fix undefined key warnings in MagicImageService

Robert Kärner CR +2 V +2 Easy +9 −6 updated 11/11/21, 11:13

Commit message

Two undefined array key warnings are fixed, which
occurred on PHP 8 when accessing the MagicImageService.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Robert Kärner +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Robert Kärner +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 810

  1. Robert Kärner uploaded patch set 1 11/10/21, 14:55

  2. core-ci voted on patch set 1 V +1 11/10/21, 15:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19125

  3. Oliver Klee voted on patch set 1 CR +1 11/10/21, 16:28

  4. Oli Bartsch commented on patch set 1 11/10/21, 16:43

    MagicImageService.php:79

    This looks like change in behaviour, since previously this was checked for being an array but is now always assigned as far as it's not NULL. However, IMO all those is_array checks are superfluous. In the end, only the maxWidth and maxHeight keys are used, which would in the current state still trigger a warning, if not defined. Therefore, my proposal for this method: $maxWidth = (int)($rteConfiguration['buttons.']['image.']['options.']['magic.']['maxWidth'] ?? 0); if ($maxWidth > 0) { $this->magicImageMaximumWidth = $maxWidth; } $maxHeight = (int)($rteConfiguration['buttons.']['image.']['options.']['magic.']['maxHeight'] ?? 0); if ($maxHeight > 0) { $this->magicImageMaximumHeight = $maxHeight; }
  5. Benni Mack commented on patch set 2 11/10/21, 20:04

    Published edit on patch set 1.
  6. core-ci voted on patch set 2 V +1 11/10/21, 20:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19149

  7. Robert Kärner commented on patch set 2 V +1 CR +1 11/10/21, 20:24

    MagicImageService.php:79 Reply Unresolved

    I agree, this sounds more reasonable. But now that Benni has pushed a new patchset, I wouldn‘t push another one, as long as you are happy with his solution too.
  8. Benni Mack voted on patch set 2 V +1 CR +1 11/10/21, 21:18

  9. Oli Bartsch voted on patch set 2 V +2 CR +2 11/11/21, 11:12

  10. Oli Bartsch merged patch set 3 11/11/21, 11:13