Skip to content
Snippets Groups Projects
Commit d3de5d55 authored by Oliver Hader's avatar Oliver Hader Committed by Oliver Hader
Browse files

[BUGFIX] Preview of moved workspace elements on source page

If e.g. a content element gets moved to a different page, the
workspace preview link opens the source page (which does not
contain the element anymore, because it was moved).

Since the elements are shown on the correct page in the
workspace backend module, using the target page in the preview
link for the frontend is just obvious.

Resolves: #59143
Releases: 6.2
Change-Id: Ib84e65766e825cc26a66cbda9ffa8132c3a3ec18
Reviewed-on: https://review.typo3.org/30474
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
parent df11f015
Branches
Tags
No related merge requests found
......@@ -528,7 +528,11 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
if ($versionRecord === NULL) {
$versionRecord = BackendUtility::getRecord($table, $uid);
}
if (VersionState::cast($versionRecord['t3ver_state'])->equals(VersionState::MOVE_POINTER)) {
$movePlaceholder = BackendUtility::getMovePlaceholder($table, $liveRecord['uid'], 'pid');
}
$previewPageId = (empty($movePlaceholder['pid']) ? $liveRecord['pid'] : $movePlaceholder['pid']);
$additionalParameters = '&tx_workspaces_web_workspacesworkspaces[previewWS]=' . $versionRecord['t3ver_wsid'];
$languageField = $GLOBALS['TCA'][$table]['ctrl']['languageField'];
......@@ -536,7 +540,7 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
$additionalParameters .= '&L=' . $versionRecord[$languageField];
}
$viewUrl = BackendUtility::viewOnClick($liveRecord['pid'], '', '', '', '', $additionalParameters);
$viewUrl = BackendUtility::viewOnClick($previewPageId, '', '', '', '', $additionalParameters);
} else {
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['viewSingleRecord'])) {
$_params = array(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment