[FOLLOWUP][TASK] Doctrine: Migrate StorageRepository 20/49720/3
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Thu, 1 Sep 2016 13:10:38 +0000 (15:10 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 1 Sep 2016 17:01:59 +0000 (19:01 +0200)
Only enable frontend restrictions if context is FE and
the TSFE is fully initialized.

Change-Id: I2126faf98a72f84c09b4ea82b2cbb605a21b4879
Resolves: #77213
Resolves: #77712
Releases: master
Reviewed-on: https://review.typo3.org/49720
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/core/Classes/Resource/StorageRepository.php

index d6345ad..b9fdd75 100644 (file)
@@ -89,7 +89,7 @@ class StorageRepository extends AbstractRepository
             $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
                 ->getQueryBuilderForTable($this->table);
 
-            if ($this->getEnvironmentMode() === 'FE') {
+            if ($this->getEnvironmentMode() === 'FE' && !empty($GLOBALS['TSFE']->sys_page)) {
                 $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
             }