Skip to content
Snippets Groups Projects
  1. Mar 15, 2024
  2. Dec 23, 2023
    • Christian Kuhn's avatar
      [!!!][FEATURE] Establish FE frontend.page.information attribute · a4cef9b3
      Christian Kuhn authored
      The patch extracts TSFE->determineId() and its sub
      methods from TSFE into TypoScriptFrontendInitialization
      middleware.
      
      The information created by these methods is modeled into
      the new DTO PageInformation, which is added as
      'frontend.page.information' request attribute before
      handling other middlewares below. The non-internal old
      properties within TSFE are set and kept as b/w compat
      layer for now.
      
      This is a powerful change: It allows us to reduce
      dependencies to TSFE significantly, which we will
      start to leverage with upcoming patches.
      
      The patch is an intermediate change as such: Looking
      at determineId() and its related methods makes clear
      the code can benefit heavily from further refactoring.
      The method could be ultimately extracted into
      a service class that only returns the 'final'
      PageInformation object, or throws exceptions for
      'early' responses. To keep the patch reviewable at
      this point, these refactorings will continue with
      additional patches.
      
      Detail notes:
      
      * TSFE->sys_page PageRepository instance is for now
        modeled as (@internal) PageInformation->pageRepository.
        This can be refactored away later: Consumers should
        create instances of that class on demand.
      
      * "original mount and shortcut page record" are also
        modeled as (@internal) PageInformation properties
        for now. They are internal handling since the redirects
        can only be created after TypoScript has been calculated
        later on, so the information has to be carried around
        for now. We *may* be able to change this later.
      
      * The two middleware properties $pageNotFound and
        $pageAccessFailureHistory are a tribute to the current
        code flow in determineId(). They should be refactored
        away when the code is further shuffled around. The
        properties currently require a hack that needs to make
        the middleware "shared: false" to circumvent side
        effects in combination with error handling sub requests.
      
      * The code flow around determineId() updates local state
        and state of PageInformation multiple times and is in
        general very hard to follow. The patch crafted this
        carefully and did not refactor the code flow heavily
        for now. Changing the early response creation strategy
        will make the code flow much more straightforward
        later.
      
      * determineId() and with it the PageInformation object
        is now created *before* TSFE is instantiated, shifting
        the instantiation to a slightly later point.
      
      * getPageAccessFailureReasons() is for now transferred
        to the middleware as well. It can be later dissolved
        when determineId() receives further refactoring. Two
        consumers (indirectly) by ShortcutAndMountPointRedirect
        middleware could be dissolved already, so the method could
        be removed from TSFE.
      
      * TSFE->linkVars needs to be dissolved soon: The strategy
        should be to create "linkVars" on demand within the
        link handling code and eventually encapsulate it with
        a runtime cache entry.
      
      * getRedirectUriForMountPoint() and getRedirectUriForShortcut()
        are relocated to ShortcutAndMountPointRedirect
        middleware. TSFE->getUriToCurrentPageForRedirect() had
        to be made (@internal) public to do that, but that method
        can be refactored away when TSFE->linkVars is dissolved.
      
      * The hacks within RedirectService are extended to deal
        with the new situation for now. The entire thing needs
        to fall at a later point completely.
      
      * Further patches should start avoiding the TSFE properties
        that are now set as b/w compat layer, and start using
        the PageInformation request attribute instead. This will
        reduce overall dependencies to TSFE significantly.
      
      Resolves: #102715
      Releases: main
      Change-Id: I6470899cf65cbaaeb2177a8b20c0800f045a070c
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82267
      
      
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      a4cef9b3
  3. Dec 09, 2023
  4. Dec 02, 2023
  5. Dec 01, 2023
  6. Feb 13, 2023
  7. Feb 01, 2023
  8. Oct 25, 2022
    • Christian Kuhn's avatar
      [FEATURE] Add TypoScript as Request attribute · e3bbf6c9
      Christian Kuhn authored
      The patch introduces the new request attribute
      TypoScriptRequestAttribute as 'frontend.typoscript'.
      
      It is set up in the Frontend middleware chain,
      extensions and content objects can use this
      attribute to retrieve TypoScript settings and
      setup.
      
      This obsoletes usages of TSFE->tmpl, the patch
      switches usages to the request attribute.
      
      Note we're also establishing a better wording:
      The old TypoScript 'constants' are now called
      'settings'. This matches much better, should avoid
      confusion for newcomers and is in line with further
      renaming of a vaguely anticipated new 'constants
      editor' towards 'settings editing' or similar.
      Further patches in this naming area will follow.
      
      Change-Id: Ib6ffb91db9bf0976f39759b12983d78418d64efa
      Resolves: #98914
      Releases: main
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76239
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: Christian Kuhn...
      e3bbf6c9
  9. Jul 10, 2022
  10. Jun 06, 2022
  11. Feb 15, 2022
  12. Jan 25, 2022
  13. Sep 04, 2021