[BUGFIX] Avoid version overlay if EXT:version is not loaded 52/50952/5
authorClaus Due <claus@namelesscoder.net>
Tue, 13 Dec 2016 16:31:36 +0000 (17:31 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Fri, 27 Jan 2017 16:13:29 +0000 (17:13 +0100)
PlainDataResolver will do semi-expensive operations for
workspaces-enabled tables even if EXT:version (and
therefore EXT:workspaces) is not loaded.

Doing a cheap check can prevent calling two such
operations and saves SQL queries and memory.

Change-Id: I6062538c3c158352b7be5748d407bbe2aad3a641
Resolves: #78982
Releases: master
Reviewed-on: https://review.typo3.org/50952
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/core/Classes/DataHandling/PlainDataResolver.php

index cd2c0c1..1e56cf1 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Core\DataHandling;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Versioning\VersionState;
 
@@ -371,7 +372,10 @@ class PlainDataResolver
      */
     protected function isWorkspaceEnabled()
     {
-        return BackendUtility::isTableWorkspaceEnabled($this->tableName);
+        if (ExtensionManagementUtility::isLoaded('version')) {
+            return BackendUtility::isTableWorkspaceEnabled($this->tableName);
+        }
+        return false;
     }
 
     /**