Project

General

Profile

Actions

Bug #83802

closed

Epic #83894: PSR-15 Initiative

Timetracker and pre-process middleware ordering is incorrect

Added by Benjamin Franzke about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2018-02-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The middlware's introduced in https://review.typo3.org/c/55537/ did not preserve the sequence as used before.

timetracker has been marked to be executed after the preprocessing:

        'typo3/cms-frontend/timetracker' => [
            'target' => \TYPO3\CMS\Frontend\Middleware\TimeTrackerInitialization::class,
            'after' => [
                'typo3/cms-frontend/preprocessing'
            ]
        ]

'timetracker' needs to be executed first, then the request 'preprocessing', as done before the mentioned change:

        // Starting time tracking
        $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']) ?: 'be_typo_user';

        /** @var TimeTracker $timeTracker */
        $timeTracker = GeneralUtility::makeInstance(TimeTracker::class, ($request->getCookieParams()[$configuredCookieName] ? true : false));
        $timeTracker->start();

        // Hook to preprocess the current request
        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] ?? [] as $hookFunction) {
            $hookParameters = [];
            GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
        }

Actions

Also available in: Atom PDF