Skip to content

Commit

Permalink
[TASK] Simplify extbase FrontendConfigurationmanager
Browse files Browse the repository at this point in the history
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: Benni Mack <benni@typo3.org>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
lolli42 committed Oct 24, 2022
1 parent fc4276c commit 3aeb6b0
Showing 1 changed file with 0 additions and 17 deletions.
Expand Up @@ -17,15 +17,12 @@

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;

/**
Expand Down Expand Up @@ -161,23 +158,9 @@ public function getConfiguration(?string $extensionName = null, ?string $pluginN

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'] ?? '')),
Expand Down

0 comments on commit 3aeb6b0

Please sign in to comment.