Review main Merged

62834[FEATURE] Improve FileDumpController

Stefan Froemken CR +2 V +2 Hard +229 −49 updated 02/24/20, 21:34

Commit message

- Add possibility to use records of sys_file_reference
- Add possibility to resize images
- Add possibility to apply cropVariants

Review

  • Code review CR +2 Done
    • Susi Moog +2
    • Daniel Goerz +1
    • Markus Klein +1
    • Frank Nägler +1
    • Christian Eßl +1
  • Verified V +2 Done
    • Susi Moog +2
    • Frank Nägler +1
    • TYPO3com +1 CI

Issues 1

Files 4

Review log 3445

Show 1320 earlier messages
  1. Stefan Froemken uploaded patch set 1 01/09/20, 08:19

  2. TYPO3com voted on patch set 1 V -1 01/09/20, 08:19 Completed build in 13s on Thu, 9 Jan, 08:19 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39763

  3. Stefan Froemken uploaded patch set 2 01/09/20, 08:29

  4. TYPO3com voted on patch set 2 V -1 01/09/20, 08:36 Completed build in 07m 11s on Thu, 9 Jan, 08:36 AM Test Summary: 69186 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39764

  5. Stefan Froemken uploaded patch set 3 01/23/20, 11:45

  6. TYPO3com voted on patch set 3 V -1 01/23/20, 11:59 Completed build in 13m 10s on Thu, 23 Jan, 11:59 AM Test Summary: 6 of 71019 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40167

  7. Stefan Froemken updated the commit message in patch set 4 01/23/20, 12:38

  8. TYPO3com voted on patch set 4 V -1 01/23/20, 12:49 Completed build in 10m 43s on Thu, 23 Jan, 12:49 PM Test Summary: 70461 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40169

  9. TYPO3com voted on patch set 4 V +1 01/23/20, 15:15 Completed build in 2h 47m 34s on Thu, 23 Jan, 03:15 PM Test Summary: 70569 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40169

  10. Oliver Klee commented on patch set 4 01/23/20, 16:06

    ImageService.php:181

    In which cases would there be a FE environment, but no TSFE?
  11. Stefan Froemken commented on patch set 4 01/23/20, 16:11

    ImageService.php:181 Reply Unresolved

    FileDumpController is an eID Script. It's the first or second call in Middleware. TSFE will be created 10 or 12 Calls later. So yes: FE can be set, but TSFE not.
  12. Susi Moog updated the commit message in patch set 5 01/24/20, 11:41

  13. Susi Moog commented on patch set 5 CR -1 01/24/20, 11:41

    Please add a feature rst file (https://forger.typo3.com/utilities/rst )
  14. TYPO3com voted on patch set 5 V +1 01/24/20, 11:51 Completed build in 10m 01s on Fri, 24 Jan, 11:51 AM Test Summary: 70569 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40184

  15. Benni Mack uploaded patch set 6 01/31/20, 14:26

  16. Benni Mack commented on patch set 6 01/31/20, 14:28

    Dear Stefan, I've reworked your patch to make it work without Extbase. A couple of questions come to mind: - Is a processedfile now always created if not handed in? - Are there additional GET/POST parameters which need documentation? - Can we actually switch to GET-only variables (the endpoint clearly is built for GET requests, not for PUT/POST/DELETE requests).
  17. TYPO3com voted on patch set 6 V +1 01/31/20, 14:40 Completed build in 13m 15s on Fri, 31 Jan, 02:40 PM Test Summary: 71182 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40419

  18. Stefan Froemken commented on patch set 6 01/31/20, 15:52

    Hello Benni, thank you for your work. Let's try to answer your questions > - Is a processedfile now always created if not handed in? If you call this eID Script with an UID of sys_processed_file which does not exists, this will not render any image. Without this record I don't know which image I should use for rendering. So processfile can not be created always. If you call it with an UID of sys_file or sys_file_reference then a processedfile will be created and be used in FE. This is a new feature, which I have to document within a rst file soon. > - Are there additional GET/POST parameters which need documentation? Previously you know this eID only with p (processed) and f (sys_file) parameter. I have added the r (sys_file_reference) Parameter to apply crop variant. That's new, too. > - Can we actually switch to GET-only variables (the endpoint clearly is built for GET requests, not for PUT/POST/DELETE requests). I don't have any problem to switch over to GET only requests. I only have adopted your code. Have a nice start into this weekend. Stefan
  19. Stefan Froemken commented on patch set 6 01/31/20, 15:56

    > - Are there additional GET/POST parameters which need documentation? The is a new parameter "s" (size). Very helpful to NOT render the full image. If not given it does (Backward-compatibility). There is a description within the file how to set/structure the size parameter. And a new parameter called "cv" (CropVariant) which is Default by default as you do within f:image VH. So, if there are multiple CropVariants defined in sys_file_reference you can now choose which CropVariant should be applied to the image.
  20. Anja Leichsenring commented on patch set 6 CR -1 02/13/20, 10:48

    we still miss the feature .rst file here that explains what the feature does and how.
  1. Stefan Froemken uploaded patch set 7 02/14/20, 20:59

  2. TYPO3com voted on patch set 7 V +1 02/14/20, 22:10 Completed build in 42m 00s on Fri, 14 Feb, 10:10 PM Test Summary: 71259 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-95

  3. Susi Moog uploaded patch set 8 02/23/20, 10:24

  4. Susi Moog uploaded patch set 9 02/23/20, 10:32

  5. Susi Moog commented on patch set 9 V +1 CR +1 02/23/20, 10:33

    - removed possibility to use POST parameters - added DI configuration to allow dependency injection of constructor argument
  6. Anja Leichsenring updated the commit message in patch set 10 02/23/20, 10:34

  7. TYPO3com voted on patch set 8 V +1 02/23/20, 10:38 Completed build in 14m 23s on Sun, 23 Feb, 10:38 AM Test Summary: 71584 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-536

  8. TYPO3com voted on patch set 9 V +1 02/23/20, 10:51 Completed build in 15m 52s on Sun, 23 Feb, 10:51 AM Test Summary: 71586 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-538

  9. TYPO3com voted on patch set 10 V +1 02/23/20, 10:58 Completed build in 22m 14s on Sun, 23 Feb, 10:58 AM Test Summary: 71586 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-539

  10. Susi Moog voted on patch set 10 V +1 CR +1 02/23/20, 11:50

  11. Christian Eßl voted on patch set 10 CR +1 02/24/20, 08:00

  12. Markus Klein commented on patch set 10 02/24/20, 08:20

    FileDumpController.php:61

    I've never seen this syntax before. I don't see it in PHP docs either. So, I'm not sure we should leave it that way or if we should (for consistency at least?) add then `()`

    Services.yaml:88

    Why do we need this entry now?
  13. Susi Moog commented on patch set 10 02/24/20, 08:54

    Services.yaml:88 Reply

    See my previous comment - to get DI for the constructor argument, the controller should be instantiated via Container.
  14. Susi Moog commented on patch set 10 02/24/20, 08:58

    FileDumpController.php:61 Reply

    This is actually fine - and was used before - take a look at the old code (or ShowImageController for example). It's used in a few places in core, and there's nothing speaking against it.
  15. Susi Moog commented on patch set 10 02/24/20, 09:03

    As for the PHP docs for new without braces: https://www.php.net/manual/en/language.oop5.basic.php "Note: If there are no arguments to be passed to the class's constructor, parentheses after the class name may be omitted. "
  16. Markus Klein commented on patch set 10 CR +1 02/24/20, 09:09

    FileDumpController.php:61 Reply

    Ack

    Services.yaml:88 Reply

    Ack
  17. Daniel Goerz voted on patch set 10 CR +1 02/24/20, 18:35

  18. Frank Nägler commented on patch set 10 CR -1 02/24/20, 19:23

    on it
  19. Frank Nägler voted on patch set 10 V +1 CR +1 02/24/20, 19:34

  20. Susi Moog voted on patch set 10 V +2 CR +2 02/24/20, 19:39

  21. Susi Moog merged patch set 11 02/24/20, 19:39

  22. Oliver Hader commented on patch set 11 02/24/20, 19:41

    FileDumpController.php:117 Unresolved

    ... means POST request (or request's body) is not supported anymore. If it's intended, it should be documented

    FileDumpController.php:140 Unresolved

    What about using a JSON encoded structure here (which would have to be filtered here)? This would allow to omit `0:0:0:0:400:300`... in order to just address maxWidth and maxHeight...

    FileDumpController.php:145 Unresolved

    ... side-note: it totally would have been okay to introduce "cropVariant" as parameter name...

    FileDumpController.php:174 Unresolved

    Could also be simplified by surrounding this method, e.g. ``` try { file = $this-createFileObjectByParameters(...); } catch (\Exception $e) { // might be more specific, but's that a different task $file = null; } ```

    FileDumpController.php:177 Unresolved

    elseif-chains could be omitted by directly returning result

    ImageService.php:181

    To make it more explicit `($GLOBALS['TSFE'] ?? null) instanceof TypoScriptFrontendController`...
  23. Oliver Hader commented on patch set 11 02/24/20, 19:42

    Hm... too slow... whatever...
  24. Oliver Hader commented on patch set 11 02/24/20, 19:45

    My most important points are: * use json-structure for `s` * mention that POST requests are not possible anymore
  25. Georg Ringer commented on patch set 11 02/24/20, 21:34

    ImageService.php:181 Reply Unresolved

    this change should be done in a separated patch and for 9 as well as bugfix. I had troubles there already in e.g eid scripts processing images. eid means frontend but still no tsfe is there which then fails later