Commit 006652a1 authored by Georg Ringer's avatar Georg Ringer Committed by Frank Nägler
Browse files

[BUGFIX] Render correct preview link in page module

If a page is translated and a translation is selected in the columns module of the
page module, the view webpage button must show the translation instead of
the default language.

Resolves: #89184
Releases: master, 9.5
Change-Id: Ib1c21a99a706e298300e355e6675839275361e28
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61713

Reviewed-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Tested-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
parent c37ea271
......@@ -706,7 +706,7 @@ class PageLayoutController
// Render the primary module content:
if ($this->MOD_SETTINGS['function'] == 1 || $this->MOD_SETTINGS['function'] == 2) {
$content .= '<form action="' . htmlspecialchars((string)$uriBuilder->buildUriFromRoute($this->moduleName, ['id' => $this->id, 'imagemode' => $this->imagemode])) . '" id="PageLayoutController" method="post">';
$content .= '<form action="' . htmlspecialchars((string)$uriBuilder->buildUriFromRoute($this->moduleName, ['id' => $this->id, 'imagemode' => $this->imagemode])) . '" id="PageLayoutController" method="post">';
// Page title
$content .= '<h1 class="t3js-title-inlineedit">' . htmlspecialchars($this->getLocalizedPageTitle()) . '</h1>';
// All other listings
......@@ -902,8 +902,17 @@ class PageLayoutController
$lang = $this->getLanguageService();
// View page
if (!VersionState::cast($this->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {
$languageParameter = $this->current_sys_language ? ('&L=' . $this->current_sys_language) : '';
$onClick = BackendUtility::viewOnClick(
$this->pageinfo['uid'],
'',
BackendUtility::BEgetRootLine($this->pageinfo['uid']),
'',
'',
$languageParameter
);
$viewButton = $this->buttonBar->makeLinkButton()
->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid'])))
->setOnClick($onClick)
->setTitle($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
->setIcon($this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL))
->setHref('#');
......
Supports Markdown
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