#105197ElementInformationController preview url uses wrong language
Description
In the Filelist when looking at file information, we list the records linked to a specific file in the “References to this item” section.
For page records we have the “View webpage” action that loads the page in a new window.
If the page is a translation, the generated URL on that action is wrong. It should be “ domain.tdl/de/german-page “ but instead it tries to open “ domain.tdl/fr/german-page “ (fr is default langage)
In other parts of the backend the URL resolving works correctly, it’s only in Filelist.
Main issue seems be in ElementInformationController.php#L494 where we don’t pass the record language to PreviewUriBuilder:
$previewUriBuilder = PreviewUriBuilder::create((int)$uid)
->withRootLine(BackendUtility::BEgetRootLine($uid));
I’ve tested by retrieving the record and pass the language and it works:
$record = BackendUtility::getRecord($table, $uid);
$previewUriBuilder = PreviewUriBuilder::create((int)$uid)
->withLanguage($record['sys_language_uid'])
->withRootLine(BackendUtility::BEgetRootLine($uid));
But to avoid all those queries, we could change ElementInformationController::getRecordActions() to pass the $row[‘sys_language_uid’] that we already have in ElementInformationController::makeRef()/makeRefFrom()
Reviews 3
History 413
-
Garvin Hicking commented and changed category status
NewNeeds Feedback 10/04/24, 19:03 -
Filipe DA COSTA commented 10/07/24, 07:20
Garvin Hicking wrote in #note-1:
> Would you like to contribute this as a patch maybe? Your code above looks like a approach proper to me. Thanks for helping!Yes, will do
-
Gerrit Code Review pushed patch set 1 for main to change 86447 status
Needs FeedbackUnder Review 10/07/24, 13:04 -
Gerrit Code Review pushed patch set 2 for main to change 86447 10/07/24, 14:53
-
Gerrit Code Review pushed patch set 3 for main to change 86447 10/07/24, 14:58
-
Gerrit Code Review pushed patch set 4 for main to change 86447 10/18/24, 14:00
-
Gerrit Code Review pushed patch set 5 for main to change 86447 10/24/24, 09:43
-
Gerrit Code Review pushed patch set 6 for main to change 86447 10/25/24, 09:10
-
Gerrit Code Review pushed patch set 7 for main to change 86447 11/15/24, 16:30
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 87013 11/18/24, 10:12
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 87014 11/18/24, 10:12
-
Filipe DA COSTA commented and changed status
Under ReviewResolved done0 %100 % 11/18/24, 10:15Applied in changeset commit:f25496504a2d714f994a602fe43160d2dcabf7d9.
-
Benni Mack changed status
ResolvedClosed 12/02/25, 14:32
Would you like to contribute this as a patch maybe? Your code above looks like a approach proper to me. Thanks for helping!