[BUGFIX] Check for loaded EXT:version in getLiveVersionIdOfRecord 74/51074/2
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:37:42 +0000 (17:37 +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/51074
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index 4529ceb..5eafa77 100644 (file)
@@ -4534,6 +4534,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');