[TASK] Add default TypoScript setting for extbase query cache
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / QueryFactory.php
index 13ff3b1..fc9c34e 100644 (file)
@@ -68,6 +68,9 @@ class QueryFactory implements QueryFactoryInterface, \TYPO3\CMS\Core\SingletonIn
 
                $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
                $querySettings->setStoragePageIds(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $frameworkConfiguration['persistence']['storagePid']));
+               if ($querySettings instanceof Typo3QuerySettings) {
+                       $querySettings->useQueryCache($frameworkConfiguration['persistence']['useQueryCache']);
+               }
                $query->setQuerySettings($querySettings);
                return $query;
        }