[BUGFIX] Declare middleware dependencies of redirects 05/57705/5
authorSusanne Moog <susanne.moog@typo3.org>
Fri, 27 Jul 2018 18:53:18 +0000 (20:53 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 30 Jul 2018 21:46:12 +0000 (23:46 +0200)
Resolves: #85426
Releases: master
Change-Id: I9752b736282e658add439ca0c6db640004f18045
Reviewed-on: https://review.typo3.org/57705
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/redirects/Classes/Service/RedirectService.php
typo3/sysext/redirects/Configuration/RequestMiddlewares.php

index 3472fde..c2bc8ef 100644 (file)
@@ -24,7 +24,6 @@ use TYPO3\CMS\Core\Resource\Exception\InvalidPathException;
 use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 use TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder;
 use TYPO3\CMS\Frontend\Typolink\UnableToLinkException;
 
@@ -227,8 +226,11 @@ class RedirectService implements LoggerAwareInterface
     }
 
     /**
-     * Instantiates a TSFE object, with the first valid page ID found, after that the following properties
-     * are available
+     * Finishing booting up TSFE, after that the following properties are available.
+     *
+     * Instantiating is done by the middleware stack (see Configuration/RequestMiddlewares.php)
+     *
+     * - TSFE->fe_user
      * - TSFE->sys_page
      * - TSFE->tmpl
      * - TSFE->config
@@ -240,12 +242,6 @@ class RedirectService implements LoggerAwareInterface
     {
         // disable page errors
         $GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_handling'] = false;
-        $GLOBALS['TSFE'] = GeneralUtility::makeInstance(
-            TypoScriptFrontendController::class,
-            null,
-            GeneralUtility::_GP('id'),
-            GeneralUtility::_GP('type')
-        );
         $GLOBALS['TSFE']->fetch_the_id();
         $GLOBALS['TSFE']->getConfigArray();
         $GLOBALS['TSFE']->settingLanguage();
index ca49e69..a649b18 100644 (file)
@@ -9,7 +9,11 @@ return [
             'target' => \TYPO3\CMS\Redirects\Http\Middleware\RedirectHandler::class,
             'before' => [
                 'typo3/cms-frontend/page-resolver',
-            ]
+            ],
+            'after' => [
+                'typo3/cms-frontend/tsfe',
+                'typo3/cms-frontend/authentication',
+            ],
         ],
     ],
 ];