[BUGFIX] Check for loaded EXT:version in getLiveVersionIdOfRecord 50/50950/4
authorThomas Hohn <tho@systime.dk>
Mon, 12 Dec 2016 11:41:10 +0000 (12:41 +0100)
committerNicole Cordes <typo3@cordes.co>
Fri, 30 Dec 2016 16:27:49 +0000 (17:27 +0100)
Omit SQL queries for each record by checking whether the "version"
extension is loaded in BackendUtility->getLiveVersionIdOfRecord()

Resolves: #78974
Releases: master, 7.6
Change-Id: If702866803d0c2b1eafc9a0c003b0e3e71c91367
Reviewed-on: https://review.typo3.org/50950
Reviewed-by: Stephan GroƟberndt <stephan@grossberndt.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Tested-by: Thomas Hohn <thomas@hohn.dk>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index a49bbbe..f52e8b0 100644 (file)
@@ -4624,6 +4624,9 @@ class BackendUtility
      */
     public static function getLiveVersionIdOfRecord($table, $uid)
     {
+        if (!ExtensionManagementUtility::isLoaded('version')) {
+            return null;
+        }
         $liveVersionId = null;
         if (self::isTableWorkspaceEnabled($table)) {
             $currentRecord = self::getRecord($table, $uid, 'pid,t3ver_oid');