#97777linkhandler config.recordLinks for news plugin (as example) not working if news article is translated
Description
I use the LinkHandler API to provide the editor with the ability to link directly to news articles. In the default language everything works fine. However, if the news article is translated, no link is rendered by the f:link.typolink-ViewHelper.
- The news detail page including the plugin is fully translated.
- In the link selection in the backend I tested it with the default language UID as well as with the translated UID of the news article record without success.
config.recordLinks {
news {
typolink {
parameter = 292
additionalParams.data = field:uid
additionalParams.wrap = &tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]=|
useCacheHash = 1
ATagParams.data = parameters:allParams
target.data = parameters:target
title.data = parameters:title
extTarget.data = parameters:target
}
forceLink = 1
}
}
My idea to include the L parameter was also unsuccessful.
...
additionalParams.wrap = &L={GP:L}&tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]=|
additionalParams.insertData = 1
...
Meanwhile I think it is a bug, so I create this ticket here. I hope someone can help or confirm that it is a bug.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 2
History 14
-
Georg Ringer commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2022-06-23T13:03:13+00:00" > 06/23/22, 13:03 </span> -
Georg Ringer changed Related to #97806 <span data-processor="relativetime" data-value="2022-06-23T13:18:21+00:00" > 06/23/22, 13:18 </span>
-
Martin R. Krause commented <span data-processor="relativetime" data-value="2022-06-30T12:30:27+00:00" > 06/30/22, 12:30 </span>
> There won’t be any change for 10 in that regard because it is not that critical.
I would considere this critical, as all links to translated records/pages that have fallbacks are gone! But those a very commen (e.g. pt_BR or en_US overlays, that hardly have translation records).
-
Martin R. Krause commented <span data-processor="relativetime" data-value="2022-06-30T14:42:38+00:00" > 06/30/22, 14:42 </span>
if ($languageAspect->doOverlays()) { $overlay = $tsfe->sys_page->getRecordOverlay( $databaseTable, $record, $languageAspect->getContentId(), $languageAspect->getLegacyOverlayType() ); if (empty($overlay['_LOCALIZED_UID'])) { $record = 0; } }This whole code DatabaseRecordLinkBuilder.php:58ff is a mystery. We load the overlay (which is expensive!) just to check that it exists, but only if we want to do overlay – which means that we work based on the default language anyways – then why check for the overlay record at all? Just link to record with its default uid – always.
-
JAKOTA Design Group GmbH commented <span data-processor="relativetime" data-value="2022-07-15T22:31:34+00:00" > 07/15/22, 22:31 </span>
Hi,
this bug can also be found in Typo3 version 11.
I’ve managed to resolve it by replacing
typo3/sysext/frontend/Classes/Typolink/DatabaseRecordLinkBuilder.php
Line 56-68
$languageAspect = $tsfe->getContext()->getAspect('language'); if ($languageAspect->doOverlays()) { $overlay = $tsfe->sys_page->getRecordOverlay( $databaseTable, $record, $languageAspect ); if (empty($overlay['_LOCALIZED_UID'])) { $record = 0; } }with
$tableControl = $GLOBALS['TCA'][$databaseTable]['ctrl'] ?? []; if (!empty($tableControl['languageField'])) { if ($record[$tableControl['languageField']] != 0 && !empty($record[$tableControl['transOrigPointerField']])) { $record = $tsfe->sys_page->checkRecord($databaseTable, $record[$tableControl['transOrigPointerField']]); } }Please have a look
Thanks
-
JAKOTA Design Group GmbH commented <span data-processor="relativetime" data-value="2022-07-16T08:05:21+00:00" > 07/16/22, 08:05 </span>
To catch records with language all -1 the line
if ($record[$tableControl['languageField']] != 0 && !empty($record[$tableControl['transOrigPointerField']])) {from my patch needs to be changed to
if ($record[$tableControl['languageField']] > 0 && !empty($record[$tableControl['transOrigPointerField']])) { -
Markus Klein commented <span data-processor="relativetime" data-value="2022-07-18T11:21:32+00:00" > 07/18/22, 11:21 </span>
> Just link to record with its default uid – always
This was the case in old TYPO3 versions. You linked to the default language UID and the L-parameter defined the language.
That’s where this comes from. (I’m very sure). -
JAKOTA Design Group GmbH commented and changed TYPO3 Version
1011 PHP Version7.48.0 <span data-processor="relativetime" data-value="2022-07-19T23:14:59+00:00" > 07/19/22, 23:14 </span>Updated Typo3 Version to 11 as this is not working here too.
-
Markus Klein commented and changed TYPO3 Version
1110 <span data-processor="relativetime" data-value="2022-07-20T06:17:57+00:00" > 07/20/22, 06:17 </span>We usually set the lowest version which is affected and might still gets patched. So v10 is okay in this case
-
Oliver Hader changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2022-11-03T11:41:37+00:00" > 11/03/22, 11:41 </span>
-
Benni Mack changed Sprint Focus
On Location Sprint<span data-processor="relativetime" data-value="2023-08-02T12:32:39+00:00" > 08/02/23, 12:32 </span> -
Astrid Haubold changed Related to #101565 <span data-processor="relativetime" data-value="2023-11-01T18:19:27+00:00" > 11/01/23, 18:19 </span>
-
Sven Burkert commented <span data-processor="relativetime" data-value="2026-02-07T09:15:26+00:00" > 02/07/26, 09:15 </span>
Seems to be fixed since TYPO3 v12.
But there, I have the opposite problem: #108894 -
Georg Ringer changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2026-02-07T09:33:50+00:00" > 02/07/26, 09:33 </span>
can you please test this in 11? I tested the following use cases
There won’t be any change for 10 in that regard because it is not that critical.