Review main Merged

70245[BUGFIX] Instantiate ImageService in ImageViewHelper constructor

Oli Bartsch CR +2 V +2 Easy +12 −10 updated 08/06/21, 13:35

Commit message

In #94491 the injection of the ImageService in the
ImageViewHelper was replaced by instantiating
with GeneralUtility. This was done, since the
ImageViewHelper is also used in the install tool,
where no DI of this service is possible.

However, since ImageService can be extended by
third-party ViewHelpers, this then broke when
accessing $this->imageService.

This is now fixed by instantiating  and assigning the
ImageService in the constructor to the $imageService
class variable. This way the DI is still not used, but
backwards compatibility is given.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Ruben Steeb +1
    • Wouter Wolters +1
    • Christian Kuhn +1
    • David Steeb +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Ruben Steeb +1
    • Christian Kuhn +1
    • David Steeb +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 89

  1. Oli Bartsch uploaded patch set 1 08/06/21, 09:10

  2. David Steeb voted on patch set 1 V +1 CR +1 08/06/21, 09:19

  3. core-ci voted on patch set 1 V +1 08/06/21, 09:24 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/14190

  4. Wouter Wolters voted on patch set 1 CR +1 08/06/21, 09:26

  5. Ruben Steeb voted on patch set 1 V +1 CR +1 08/06/21, 09:29

  6. Christian Kuhn voted on patch set 1 CR -1 08/06/21, 09:45

  7. Christian Kuhn commented on patch set 1 V +1 CR +1 08/06/21, 10:36

    ok, no other way to solve this for now. but i'll create a couple of further patches to prepare preventing such situations in v12.
  8. Oli Bartsch voted on patch set 1 V +2 CR +2 08/06/21, 13:35

  9. Oli Bartsch merged patch set 2 08/06/21, 13:35