Review main Abandoned

76133[BUGFIX] Remove dependency injection from resource controller

Oliver Hader CR 0 V 0 Easy +20 −29 updated 10/22/22, 08:05

Commit message

Issue #98620 introduced a regression when trying to apply dependency
injection to \TYPO3\CMS\RteCKEditor\Controller\ResourceController.

Review

  • Code review CR 0
  • Verified V 0

Issues 2

Files 5

Review log 79

  1. Oliver Hader uploaded patch set 1 10/17/22, 21:54

  2. core-ci voted on patch set 1 V +1 10/17/22, 22:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32406

  3. Frank Nägler commented on patch set 1 10/18/22, 06:36

    Just to be sure and understand the patch, DI via constructor is not working, but with GU::makeInstance? That is the solution for the core? Or why constructor is not working?
  4. Oli Bartsch updated the commit message in patch set 2 10/18/22, 10:20

  5. core-ci voted on patch set 2 V +1 10/18/22, 10:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32428

  6. Benni Mack voted on patch set 2 CR +1 10/20/22, 15:04

  7. Christian Kuhn commented on patch set 2 CR -1 10/21/22, 20:06

    ResourceController.php:46 Unresolved

    use constructor property promotion.

    RichTextElement.php:145

    i don't like this architecture much: controllers should always only be used by request handlers, calling a controller method by some lower-level class is fishy. is it possible to create a better abstraction here?

    ScssProcessor.php:34 Unresolved

    use constructor property promotion.
  8. Oliver Hader commented on patch set 2 10/22/22, 08:04

    RichTextElement.php:145 Reply Unresolved

    No shit Sherlock, this is literally what is written as comment in the other class: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76133/2/typo3/sysext/rte_ckeditor/Classes/Controller/ResourceController.php#b82 > // this is shit and needs to be a general token/payload component, having signatures (JWT?) Anyway, it is a static function (not an instance method). Basically the controller knows best which arguments it accepts and needs to verify. Changing this, requires a generic approach, which does not exist yet (like OpenAPI). Other HMAC implementations in the core just repeat the hashing logic - at the location where the hash is generated, and again at the place were the hash is verified. This is even more of a bad architecture. Example? Just search for `'resourceStorageDumpFile'` in the sources...
  9. Oliver Hader abandoned the change 10/22/22, 08:05

    I'm dropping this change, I cannot reproduce the DI problems I had last Monday without this patch anymore...