[BUGFIX] Avoid live ID processing if EXT:version not loaded 70/50970/7
authorThomas Hohn <tho@systime.dk>
Tue, 13 Dec 2016 20:08:07 +0000 (21:08 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 27 Mar 2017 20:13:48 +0000 (22:13 +0200)
DataHandler does not need to force "live ID" processing to
be enabled on RelationHandler when EXT:version is not loaded.

Avoiding this saves some semi-expensive operations inside
the RelationHandler class.

Resolves: #78998
Releases: master
Change-Id: If53cdd73db15352d6f4854a5aef4b407836cb6ce
Reviewed-on: https://review.typo3.org/50970
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Claus Due <claus@phpmind.net>
Tested-by: Thomas Hohn <thomas@hohn.dk>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 4790f0d..16811a8 100644 (file)
@@ -40,6 +40,7 @@ use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Service\OpcodeCacheService;
 use TYPO3\CMS\Core\Type\Bitmask\Permission;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\File\BasicFileUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
@@ -9065,8 +9066,11 @@ class DataHandler
      */
     protected function createRelationHandlerInstance()
     {
+        $isVersionLoaded = ExtensionManagementUtility::isLoaded('version');
         $relationHandler = GeneralUtility::makeInstance(RelationHandler::class);
         $relationHandler->setWorkspaceId($this->BE_USER->workspace);
+        $relationHandler->setUseLiveReferenceIds($isVersionLoaded);
+        $relationHandler->setUseLiveParentIds($isVersionLoaded);
         return $relationHandler;
     }