Project

General

Profile

Actions

Bug #99640

closed

f:format.html not working in backend context

Added by Oliver Weiss about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
Start date:
2023-01-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

When using f:format.html in backend context (e.g. template in a scheduler), the parseFunc doesn't return anything.

The method simulateFrontendEnvironment creates $GLOBALS['TSFE'] and $GLOBALS['TSFE']->tmpl with new standard classes:
typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlViewHelper.php, Line 134:

    protected static function simulateFrontendEnvironment()
    {
        self::$tsfeBackup = $GLOBALS['TSFE'] ?? null;
        $GLOBALS['TSFE'] = new \stdClass();
        $GLOBALS['TSFE']->tmpl = new \stdClass();
        $configurationManager = GeneralUtility::makeInstance(ConfigurationManagerInterface::class);
        $GLOBALS['TSFE']->tmpl->setup = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
    }

In the ContentObjectRenderer, the method mergeTSRef has changed. Since V 11, it checks the class types of $GLOBALS['TSFE'] and $GLOBALS['TSFE']->tmpl and this check fails now
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php, Line 5552:

           if ($tsfe instanceof TypoScriptFrontendController
                && $tsfe->tmpl instanceof TemplateService
                && is_array($tsfe->tmpl->setup)
            ) {
                $setupArray = $tsfe->tmpl->setup;
            }

Possible solution is to make new instances of the correct classes in simulateFrontendEnvironment().

Actions #1

Updated by Chris Müller about 1 year ago

  • Status changed from New to Needs Feedback
Actions #2

Updated by Sybille Peters about 1 year ago

  • Status changed from Needs Feedback to Closed

As pointed out: is not a bug and is documented that vh should not be used in BE.

No feedback for 2 months.

Closing for now.

Actions

Also available in: Atom PDF