Skip to content

Commit

Permalink
[BUGFIX] ExpressionLanguage function getDocumentType of `DocumentTy…
Browse files Browse the repository at this point in the history
…peFunctionProvider` does not work correctly (#1359)

Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
markusweigelt and sebastian-meyer authored Oct 21, 2024
1 parent 70f1200 commit e1b180c
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
use TYPO3\CMS\Core\ExpressionLanguage\RequestWrapper;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;

/**
Expand Down Expand Up @@ -58,16 +57,6 @@ public function getFunctions(): array
*/
protected ?Document $document;

/**
* @var ConfigurationManager
*/
protected $configurationManager;

public function injectConfigurationManager(ConfigurationManager $configurationManager): void
{
$this->configurationManager = $configurationManager;
}

/**
* @var DocumentRepository
*/
Expand All @@ -91,9 +80,10 @@ public function injectDocumentRepository(DocumentRepository $documentRepository)
*/
protected function initializeRepositories(int $storagePid): void
{
$frameworkConfiguration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
$frameworkConfiguration['persistence']['storagePid'] = MathUtility::forceIntegerInRange((int) $storagePid, 0);
$this->configurationManager->setConfiguration($frameworkConfiguration);
$configurationManager = GeneralUtility::makeInstance(ConfigurationManagerInterface::class);
$frameworkConfiguration = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
$frameworkConfiguration['persistence']['storagePid'] = MathUtility::forceIntegerInRange($storagePid, 0);
$configurationManager->setConfiguration($frameworkConfiguration);
$this->documentRepository = GeneralUtility::makeInstance(DocumentRepository::class);
}

Expand Down

0 comments on commit e1b180c

Please sign in to comment.