Commit 0914c0bc authored by Nicole Cordes's avatar Nicole Cordes Committed by Andreas Fernandez
Browse files

[BUGFIX] Ensure linkText is returned for missing languages

This patch ensures the linkText is returned and used if
the target page is not available in the current language.

Resolves: #90182
Releases: master, 10.4
Change-Id: Ifed1921ff42746582dd5abab93fafe7a29c12233
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64796


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent fae4865a
......@@ -20,6 +20,7 @@ ignoreFiles+="sysext/extbase/Classes/Core/Bootstrap.php"
ignoreFiles+="sysext/form/Classes/Mvc/Property/Exception/TypeConverterException.php"
ignoreFiles+="sysext/core/Classes/Database/Driver/PDOStatement.php"
ignoreFiles+="sysext/core/Classes/Database/Driver/PDOConnection.php"
ignoreFiles+="sysext/frontend/Classes/Typolink/PageLinkBuilder.php"
# both ActionController and AbstractController throw the same exceptions
# until AbstractController is removed
......
......@@ -184,7 +184,11 @@ class PageLinkBuilder extends AbstractTypolinkBuilder
// Link to a page that has a site configuration
if ($siteOfTargetPage !== null) {
$siteLanguageOfTargetPage = $this->getSiteLanguageOfTargetPage($siteOfTargetPage, (string)($conf['language'] ?? 'current'));
try {
$siteLanguageOfTargetPage = $this->getSiteLanguageOfTargetPage($siteOfTargetPage, (string)($conf['language'] ?? 'current'));
} catch (UnableToLinkException $e) {
throw new UnableToLinkException($e->getMessage(), $e->getCode(), $e, $linkText);
}
$languageAspect = LanguageAspectFactory::createFromSiteLanguage($siteLanguageOfTargetPage);
// Now overlay the page in the target language, in order to have valid title attributes etc.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment