#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 <span data-processor="relativetime" data-value="2024-10-04T19:03:15+00:00" > 10/04/24, 19:03 </span> -
Filipe DA COSTA commented <span data-processor="relativetime" data-value="2024-10-07T07:20:46+00:00" > 10/07/24, 07:20 </span>
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 <span data-processor="relativetime" data-value="2024-10-07T13:04:52+00:00" > 10/07/24, 13:04 </span> -
Gerrit Code Review pushed patch set 2 for main to change 86447 <span data-processor="relativetime" data-value="2024-10-07T14:53:59+00:00" > 10/07/24, 14:53 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 86447 <span data-processor="relativetime" data-value="2024-10-07T14:58:04+00:00" > 10/07/24, 14:58 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 86447 <span data-processor="relativetime" data-value="2024-10-18T14:00:32+00:00" > 10/18/24, 14:00 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 86447 <span data-processor="relativetime" data-value="2024-10-24T09:43:48+00:00" > 10/24/24, 09:43 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 86447 <span data-processor="relativetime" data-value="2024-10-25T09:10:21+00:00" > 10/25/24, 09:10 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 86447 <span data-processor="relativetime" data-value="2024-11-15T16:30:18+00:00" > 11/15/24, 16:30 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 87013 <span data-processor="relativetime" data-value="2024-11-18T10:12:37+00:00" > 11/18/24, 10:12 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 87014 <span data-processor="relativetime" data-value="2024-11-18T10:12:45+00:00" > 11/18/24, 10:12 </span>
-
Filipe DA COSTA commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2024-11-18T10:15:10+00:00" > 11/18/24, 10:15 </span>Applied in changeset commit:f25496504a2d714f994a602fe43160d2dcabf7d9.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:32:50+00:00" > 12/02/25, 14:32 </span>
Would you like to contribute this as a patch maybe? Your code above looks like a approach proper to me. Thanks for helping!