[BUGFIX] Use live record uid for preview in workspace 70/55070/8
authorChristian Weiske <weiske@mogic.com>
Tue, 26 Jun 2018 19:46:25 +0000 (21:46 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 25 Mar 2019 15:02:51 +0000 (16:02 +0100)
When editing a record in a workspace in the Backend,
the "preview" button needs to use the live record uid
and not the uid of the workspace version.

Change-Id: I690c11e50b6275290175397cc9f28e1532b1d61d
Releases: master, 9.5
Resolves: #81271
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/55070
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/backend/Classes/Controller/EditDocumentController.php

index 513cf4a..d4cecdf 100644 (file)
@@ -834,6 +834,11 @@ class EditDocumentController
             }
         }
 
+        // Always use live workspace record uid for the preview
+        if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] ?? false && $recordArray['t3ver_oid'] > 0) {
+            $recordId = $recordArray['t3ver_oid'];
+        }
+
         // map record data to GET parameters
         if (isset($previewConfiguration['fieldToParameterMap.'])) {
             foreach ($previewConfiguration['fieldToParameterMap.'] as $field => $parameterName) {