Project

General

Profile

Actions

Bug #102457

closed

FrontendConfigurationManager->getTypoScriptSetup() should return empty array if TSFE is not initialized

Added by Markus Gerdes 12 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Start date:
2023-11-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

As written in the comment of the FrontendConfigurationManager Line 202ff the setup should be an empty array in v12 to be backward compatible.
If

$request->getAttribute('frontend.typoscript');

returns null this would not be a RuntimeException and should be checked separately.

Steps to reproduce:
install extension and call the included middleware.

This results in an Errorpage

Call to a member function getSetupArray() on null

in /var/www/html/vendor/typo3/cms-extbase/Classes/Configuration/FrontendConfigurationManager.php line 202
        /** @var ServerRequestInterface $request */
        $request = $this->request ?? $GLOBALS['TYPO3_REQUEST'];
        $frontendTypoScript = $request->getAttribute('frontend.typoscript');
        try {
            return $frontendTypoScript->getSetupArray();
        } catch (\RuntimeException) {
            // This Extbase bootstrap is executed in a context where TSFE did not calculate TS.
            //
            // This catch mitigates a "You're doing in wrong" case in TYPO3 v12:```

Environment:
TYPO3 v12.4.8
PHP 8.2.1
Linux

Actions #1

Updated by Gerrit Code Review 12 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81863

Actions #2

Updated by Simon Schaufelberger 12 months ago

This seams like a bug in the extension

Actions #3

Updated by Gerrit Code Review 12 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81863

Actions #4

Updated by Gerrit Code Review 12 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81863

Actions #5

Updated by Gerrit Code Review 12 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81962

Actions #6

Updated by Markus Gerdes 12 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Markus Gerdes 12 months ago

Thanks everybody for fixing in light speed ;-)

Actions #8

Updated by Benni Mack 4 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF