Issue Bug Closed

#110160Translated "Link" page (doktype=3) always links to the default language URL

Bastien Lutz 07/06/26, 13:14 updated 08/11/26, 08:51

Description

A page of doktype “Link” that has a translation with its own, distinct
`link` field value renders with the correctly translated title/label, but
the generated href always points to the default language’s URL instead of
the translated one.

*Steps to reproduce:*
1. Create a page with doktype “Link” (`pages.doktype = 3`) in the default
language, e.g. `link = https://example.com/de/some-page`, title
`Beispiel`.
2. Create a translation of that page (e.g. English), with:
– `title = Example`
– `link = https://example.com/en/some-page/en` (a distinct value, not
synchronized from the default language)
3. Reference this page in a menu so it appears in the frontend of both languages.
4. Render the page in the default language: the menu item shows title
`Beispiel`, linking to `https://example.com/de/some-page`. Correct.
5. Render the page in the translated language: the menu item
shows the translated title `Example`, but the `href` still
points to `https://example.com/de/some-page` instead of `https://example.com/en/some-page/en`.

Analysis:

In PageLinkBuilder::buildLink() the target page is resolved twice:

$originalPage = $this->resolvePage($linkDetails, $configuration, $disableGroupAccessCheck, false);
$resolvedPage = $this->resolvePage($linkDetails, $configuration, $disableGroupAccessCheck);

Later, $resolvedPage is overlaid into the target language:

if ($siteLanguageOfTargetPage->getLanguageId() > 0) {
    ...
    $resolvedPage = $pageRepository->getLanguageOverlay('pages', $resolvedPage);
    ...
}

$resolvedPage (now correctly translated) is used to build the title/label
of the link. However, $originalPage is never overlaid, and is further down used to read the actual link target for doktype “Link” pages.

Reviews 2

History 58

  1. Bastien Lutz commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-07-28T14:15:09+00:00" > 07/28/26, 14:15 </span>

    Applied in changeset commit:e365aac439b8b9a130fa4309c1f1da81382ccaf6.