Issue Bug Closed

#90031Wrong link calculation when languages in Site configuration are ordered non-ascendingly

Mario Lubenka 12/29/19, 03:33 updated 11/06/26, 12:32

Description

In the case where the languages in the Site configuration are not ordered by languageId it will not use the language with langId=0 as default page but the very first entry.

languages:
  -
    title: Japanese
    enabled: true
    languageId: '2'
    base: /jp
  -
    title: English
    enabled: true
    languageId: '0'
    base: /

This will cause wrong link calculation when opening a frontend page from the backend, as it will (in the above case) use the English page title with the Japanese base.

Reviews 3

History 518

  1. Gerrit Code Review pushed patch set 1 for master to change 62779 status New Under Review <span data-processor="relativetime" data-value="2019-12-29T03:35:23+00:00" > 12/29/19, 03:35 </span>

  2. Mario Lubenka changed subject Default language when languages in Site configuration are ordered differently Wrong link calculation when languages in Site configuration are ordered non-ascendingly <span data-processor="relativetime" data-value="2019-12-29T03:41:28+00:00" > 12/29/19, 03:41 </span>

  3. Mario Lubenka commented <span data-processor="relativetime" data-value="2019-12-29T18:30:11+00:00" > 12/29/19, 18:30 </span>

    Riccardo De Contardi wrote:
    > Is this one related? #84671

    If languages become sortable via the backend the problem I described will occur more frequently.
    Right now this only happens if one does that directly in the site configuration YAML file.

  4. Benni Mack commented and changed status Under Review Closed <span data-processor="relativetime" data-value="2026-11-06T12:32:49+00:00" > 11/06/26, 12:32 </span>

    This has been fixed with #99064 (https://review.typo3.org/c/Packages/TYPO3.CMS/+/97053, backported to 14.3 via https://review.typo3.org/c/Packages/TYPO3.CMS/+/97225): Site::getDefaultLanguage() now returns language 0 regardless of its position in the site configuration, which also fixes the preview link generation described here. The original patch (62779) was abandoned. Closing as duplicate of #99064.