Skip to content

Commit

Permalink
[BUGFIX] Have ElementInformationController preview url use correct la…
Browse files Browse the repository at this point in the history
…nguage

If displaying page actions, use the target pages'
sys_language_uid to build the frontend URL.

Resolves: #105197
Releases: main, 13.4, 12.4
Change-Id: I5277bcbf09574188ee67cbabccb4fe59b3ec7b7f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87014
Tested-by: Benni Mack <[email protected]>
Tested-by: core-ci <[email protected]>
Reviewed-by: Benni Mack <[email protected]>
  • Loading branch information
dacostafilipe authored and bmack committed Nov 18, 2024
1 parent 8781a57 commit faa4891
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,13 @@ protected function getRecordActions($table, $uid, ServerRequestInterface $reques
// Recordlist button
$actions['webListUrl'] = (string)$this->uriBuilder->buildUriFromRoute('web_list', ['id' => $uid, 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri()]);

// retrieve record to get page language
$record = BackendUtility::getRecord($table, $uid);

$previewUriBuilder = PreviewUriBuilder::create((int)$uid)
->withLanguage((int)($record[$GLOBALS['TCA'][$table]['ctrl']['languageField'] ?? null] ?? 0))
->withRootLine(BackendUtility::BEgetRootLine($uid));

// View page button
$actions['previewUrlAttributes'] = $previewUriBuilder->serializeDispatcherAttributes();
}
Expand Down

0 comments on commit faa4891

Please sign in to comment.