Review main Merged Breaking

75779[!!!][TASK] Avoid Extbase Request init in StandaloneView

Christian Kuhn CR +2 V +2 Normal +120 −20 updated 09/29/22, 20:48

Commit message

The StandaloneView has a very unfortunate flaw in
__construct(): It creates an Extbase Request by
default without asking and adds it to RenderingContext.

The patch removes this default initialization.

StandaloneView is typically *not* used within Extbase
context: Extbase by default uses TemplateView.

As such, creating an Extbase Request in StandaloneView
by default is bad, since it switches context to Extbase
when it shouldn't. This can make ViewHelpers behave differently
and in general adds trouble and cross dependencies.

As a side effect, some ViewHelpers will now actively refuse
to work in non-extabse context and throw exceptions. Most
notably, f:form and f:form.* throw exceptions when used
in a FLUIDTEMPLATE content object. We *might* be able to
relax this during further v12 development, though.

It is possible we later add a factory to the Fluid views
in general that takes care of setting a request to the view.
This however needs some streamlining in Fluid standalone
library first and requires some further decisions.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 4

Review log 3041

Show 1016 earlier messages
  1. Christian Kuhn uploaded patch set 1 09/19/22, 14:52

  2. core-ci voted on patch set 1 V -1 09/19/22, 15:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31275

  3. Oliver Klee commented on patch set 1 09/19/22, 16:48

    Typo: Reqeust -> Request
  4. Christian Kuhn uploaded patch set 2 09/19/22, 16:48

  5. Christian Kuhn commented on patch set 1 09/19/22, 16:49

    Reply

    Done
  6. Christian Kuhn updated the commit message in patch set 3 09/19/22, 16:49

  7. core-ci voted on patch set 3 V -1 09/19/22, 16:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31281

  8. Christian Kuhn uploaded patch set 4 09/19/22, 17:41

  9. core-ci voted on patch set 4 V -1 09/19/22, 17:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31283

  10. Christian Kuhn uploaded patch set 5 09/19/22, 17:53

  11. core-ci voted on patch set 5 V +1 09/19/22, 18:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31284

  12. Chris Müller uploaded patch set 6 09/19/22, 18:06

  13. core-ci voted on patch set 6 V +1 09/19/22, 18:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31286

  14. Stefan Bürk updated the commit message in patch set 7 09/19/22, 18:55

  15. Stefan Bürk updated the commit message in patch set 8 09/19/22, 18:55

  16. core-ci voted on patch set 7 V +1 09/19/22, 19:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31291

  1. core-ci voted on patch set 8 V +1 09/19/22, 19:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31292

  2. Stefan Bürk voted on patch set 8 V +1 CR +1 09/19/22, 19:13

  3. Georg Ringer commented on patch set 8 09/19/22, 19:50

    what about moving those VH to extbase then?
  4. Stefan Bürk commented on patch set 8 09/19/22, 20:56

    Reply

    Either that .. or do not use the extbase uri build in it. Anyway I think this should be done in dedicated patch then.
  5. Christian Kuhn commented on patch set 8 09/19/22, 21:50

    Reply

    yes and no: moving VH's to extbase leads to additional tasks for consumers - they'll have to move namespaces. also, we already have some 'hybrid' VH's already (f:translate especially). In general, the main fate of ext:fluid VH's has not been decided, yet. And it also only makes sense to start thinking about this when all non-VH related classes in ext:fluid are gone (since we'd then end up with that extension being gone, and the parser related extensions are even more harder to get rid of / move than the VH's). I'd be happy to discuss on this, also to see what needs to be done in fluid standalone.
  6. Christian Kuhn commented on patch set 8 09/19/22, 21:51

    for now, i'm trying to sharpen the VH's, while i'm also trying to simplify ext:fluid in general ...
  7. Benjamin Franzke commented on patch set 8 CR -2 09/20/22, 06:18

    Sorry, Christian, but this is a -2 from my side. I think we can't break f:link.page and f:uri.page in FLUIDTEMPLATE, it's just *too* common and I don't see the the technical need for a breaking change here. If you really want them to go, we need a deprecation. As talked about some months ago: We need to make f:link.page and f:uri.page work without extbase – ideally let them use typolink directly, breaking them is not an option IMO. Thus hurts developers during upgrades. It's not clear why these viewhelpers should ever have been bad practice in FLUIDTEMPLATE and now cause a breaking change without deprecation, given that f:link.typolink (added in v7) came later than f:link.page and f:uri.page (available since v6).
  8. Benni Mack commented on patch set 8 09/20/22, 06:48

    I will update the patch to use native Core functionality for f:link.page and f:link.uri
  9. Christian Kuhn uploaded patch set 9 09/29/22, 13:03

  10. Christian Kuhn voted on patch set 9 CR -1 09/29/22, 13:03

  11. Christian Kuhn uploaded patch set 10 09/29/22, 13:04

  12. core-ci voted on patch set 10 V +1 09/29/22, 13:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31707

  13. core-ci voted on patch set 9 V +1 09/29/22, 13:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31706

  14. Christian Kuhn uploaded patch set 11 09/29/22, 13:35

  15. core-ci voted on patch set 11 V +1 09/29/22, 13:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31710

  16. Benjamin Franzke commented on patch set 11 CR 0 09/29/22, 14:18

    Thanks Benni/Christian for adapting f:*.page in https://review.typo3.org/c/Packages/TYPO3.CMS/+/75808 Removing my -2
  17. Stefan Bürk voted on patch set 11 V +1 CR +1 09/29/22, 14:29

  18. Benjamin Franzke commented on patch set 11 09/29/22, 14:48

    Hm.. not sure about this sentence. The security-relevant hidden form fields are relevant when linking from outside extbase-context into extbase-context (example: <f:form> that links to indexed-search page via rendered via StandaloneView/FLUIDTEMPLATE). The security relevant fields are added and checked in that case, so I'm not sure where the case you're describing actually applies. I mean: It would only apply when not linking to an extbase action, but well, that's what <f:form> is about and you can only link to a controller/action. I'd rather leave that sentence out or otherwise I'd be very interested in an example that demonstrates the issue mentioned here.
  19. Christian Kuhn uploaded patch set 12 09/29/22, 20:15

  20. Christian Kuhn commented on patch set 12 09/29/22, 20:15

    Reply

    Done
  21. Benni Mack commented on patch set 12 V +1 CR +1 09/29/22, 20:17

    fine with me now
  22. Stefan Bürk voted on patch set 12 V +1 CR +1 09/29/22, 20:18

  23. core-ci voted on patch set 12 V +1 09/29/22, 20:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31718

  24. Christian Kuhn voted on patch set 12 V +2 CR +2 09/29/22, 20:48

  25. Christian Kuhn merged patch set 13 09/29/22, 20:48