[BUGFIX] Fix record preview 58/60758/4
authorDaniel Dorndorf <dorndorf@featdd.de>
Wed, 15 May 2019 08:24:33 +0000 (10:24 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 15 May 2019 09:23:01 +0000 (11:23 +0200)
A wrong evaluation of the null coalesce
assignment (?? is evaluted and && later-on),
the if() condition was always true for
any previews of records with versioning
enabled.

The Backend API is used instead.

Resolves: #88356
Releases: master, 9.5
Change-Id: I89ba14bd99bbeb17637b64d99a8d6de265a6e7c4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60758
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/backend/Classes/Controller/EditDocumentController.php

index 1ebb040..717b50a 100644 (file)
@@ -835,7 +835,7 @@ class EditDocumentController
         }
 
         // Always use live workspace record uid for the preview
-        if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] ?? false && $recordArray['t3ver_oid'] > 0) {
+        if (BackendUtility::isTableWorkspaceEnabled($table) && $recordArray['t3ver_oid'] > 0) {
             $recordId = $recordArray['t3ver_oid'];
         }