Bug #105197
closedElementInformationController preview url uses wrong language
100%
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()
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!
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
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
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
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
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
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
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
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
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
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
Updated by Filipe DA COSTA 4 days ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f25496504a2d714f994a602fe43160d2dcabf7d9.