Skip to content
  • Christian Kuhn's avatar
    [!!!][TASK] Avoid Extbase Request init in StandaloneView · 77fd49ff
    Christian Kuhn authored
    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.
    
    Change-Id: I1cf7b8a7baf5280d67f887c55b7b6493942c136a
    Resolves: #98377
    Related: #96473
    Releases: main
    Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75779
    
    
    Tested-by: default avatarBenni Mack <benni@typo3.org>
    Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
    Tested-by: default avatarcore-ci <typo3@b13.com>
    Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    Reviewed-by: default avatarBenni Mack <benni@typo3.org>
    Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
    Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    77fd49ff