Review main Merged

81502[TASK] Remove dead catch in ImageViewHelper

Nikita Hovratov CR +2 V +2 Easy +0 −6 updated 10/22/23, 14:27

Commit message

RuntimeException is never thrown in the executed code of
ImageViewHelper. Reason is, that the image either is
inside the fallback storage "0" or it was already
caught by InvalidArgumentException catch block.

For reference: There is no way to find out, which
RuntimeException the author meant to catch. I assume it
was the one in AbstractFile->getStorage (code: 1381570091).

Review

  • Code review CR +2 Done
    • Nikita Hovratov +2
    • Oliver Klee +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Nikita Hovratov +2
    • Oliver Klee +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 810

  1. Nikita Hovratov uploaded patch set 1 10/22/23, 12:35

  2. Nikita Hovratov uploaded patch set 2 10/22/23, 12:40

  3. core-ci voted on patch set 1 V +1 10/22/23, 12:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48038

  4. core-ci voted on patch set 2 V +1 10/22/23, 12:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48039

  5. Christian Kuhn voted on patch set 2 V +1 CR +1 10/22/23, 13:17

  6. Christian Kuhn commented on patch set 2 10/22/23, 13:18

    maybe skip v12 if we're not entirely really very sure this is fine?
  7. Nikita Hovratov commented on patch set 2 10/22/23, 14:02

    Reply

    So, of course I can't be 100% sure, but therefore I added a pre-patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/81498 to show, what can go wrong. I tried really hard to trigger this exception, but IMO the image from ImageService->getImage() ALWAYS has a storage. I would really like to keep these patches in sync with v12, because I plan to refactor ImageViewHelper and this should also go into v12. I need this for Content Blocks and it benefits people who are struggling with v12 final classes. So, what would be the impact? Either way an exception would be thrown. In production this would result most likely in "oops an error occured" in the position of the image. My understanding is, that these exceptions are only caught and rethrown as FluidExceptions so that the "TolerantErrorHandler" of fluid can render these exceptions as text and maybe some logging is made. But I can't see any usage of this ErrorHandler. In core FLUIDTEMPLATE this is not configurable and the StandardErrorHandler is always used. Did I miss something?
  8. Oliver Klee voted on patch set 2 V +1 CR +1 10/22/23, 14:21

  9. Nikita Hovratov voted on patch set 2 V +2 CR +2 10/22/23, 14:27

  10. Nikita Hovratov merged patch set 3 10/22/23, 14:27