Skip to content
Snippets Groups Projects
Commit 3aeb6b09 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Simplify extbase FrontendConfigurationmanager

The "is backend" check will never kick in since this is
dispatched in ConfigurationManager already.

Resolves: #98721
Related: #98578
Releases: main
Change-Id: I9afca12237a618903d47757a6960500058106c21
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76244


Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent fc4276c6
Branches
Tags
No related merge requests found
......@@ -17,15 +17,12 @@ declare(strict_types=1);
namespace TYPO3\CMS\Extbase\Configuration;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
use TYPO3\CMS\Core\Http\ApplicationType;
use TYPO3\CMS\Core\Service\FlexFormService;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\TypoScript\TypoScriptService;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\FrontendSimulatorUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
/**
......@@ -161,23 +158,9 @@ class FrontendConfigurationManager implements SingletonInterface
if (!empty($frameworkConfiguration['persistence']['storagePid'])) {
if (is_array($frameworkConfiguration['persistence']['storagePid'])) {
// We simulate the frontend to enable the use of cObjects in
// stdWrap. We then convert the configuration to normal TypoScript
// and apply the stdWrap to the storagePid
$isBackend = ($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface
&& ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend();
if ($isBackend) {
// @todo: This BE specific switch should be moved to BackendConfigurationManager to drop the dependency to $GLOBALS['TYPO3_REQUEST'] here.
// Use makeInstance here since extbase Bootstrap always setContentObject(null) in Backend, no need to call getContentObject().
FrontendSimulatorUtility::simulateFrontendEnvironment(GeneralUtility::makeInstance(ContentObjectRenderer::class));
}
$conf = $this->typoScriptService->convertPlainArrayToTypoScriptArray($frameworkConfiguration['persistence']);
$frameworkConfiguration['persistence']['storagePid'] = $GLOBALS['TSFE']->cObj->stdWrapValue('storagePid', $conf);
if ($isBackend) {
FrontendSimulatorUtility::resetFrontendEnvironment();
}
}
if (!empty($frameworkConfiguration['persistence']['recursive'])) {
$storagePids = $this->getRecursiveStoragePids(
GeneralUtility::intExplode(',', (string)($frameworkConfiguration['persistence']['storagePid'] ?? '')),
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment