Project

General

Profile

Actions

Bug #105197

closed

ElementInformationController preview url uses wrong language

Added by Filipe DA COSTA about 2 months ago. Updated 4 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2024-10-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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()

Actions #1

Updated by Garvin Hicking about 2 months ago

  • Category set to Localization
  • Status changed from New to Needs Feedback

Would you like to contribute this as a patch maybe? Your code above looks like a approach proper to me. Thanks for helping!

Actions #2

Updated by Filipe DA COSTA about 2 months ago

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

Actions #3

Updated by Gerrit Code Review about 2 months ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86447

Actions #4

Updated by Gerrit Code Review about 2 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86447

Actions #5

Updated by Gerrit Code Review about 2 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86447

Actions #6

Updated by Gerrit Code Review about 1 month ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86447

Actions #7

Updated by Gerrit Code Review 29 days ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86447

Actions #8

Updated by Gerrit Code Review 28 days ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86447

Actions #9

Updated by Gerrit Code Review 7 days ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86447

Actions #10

Updated by Gerrit Code Review 4 days ago

Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87013

Actions #11

Updated by Gerrit Code Review 4 days ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87014

Actions #12

Updated by Filipe DA COSTA 4 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF