Issue Bug Closed

#93765Extbase loses language overlay for related records

Philipp Idler 03/17/21, 12:53 updated 03/31/26, 09:00

Description

I have one record with sys_language_uid -1 set up and one relation to sys_category.
My category is translated in all existing languages, e.g. norwegian.

When I open that record in frontend for norwegian language I would except that extbase selects my translated norwegian category but instead default language is shown.
Seems like extbase doesn’t respect current selected site language for me.

My language setting for default and norwegian language:

languages:
  -
    title: de
    enabled: true
    base: /
    typo3Language: de
    locale: de_DE.UTF-8
    iso-639-1: de
    navigationTitle: DE
    hreflang: de-DE
    direction: ''
    flag: ch
    languageId: '0'
  -
    title: NO
    enabled: true
    base: /no/
    typo3Language: default
    locale: no_NO.UTF-8
    iso-639-1: no
    navigationTitle: NO
    hreflang: no-NO
    direction: ''
    fallbackType: strict
    fallbacks: ''
    flag: no
    languageId: '1'

Reviews 6

History 1115

  1. Alexander König commented and changed TYPO3 Version 9 11 PHP Version 7.2 7.4 Complexity hard <span data-processor="relativetime" data-value="2022-06-09T14:12:42+00:00" > 06/09/22, 14:12 </span>

    Hi, guess I have the same issue but with a different configuration:
    I got translated records for products. Each product has multiple productProperties which are not translated and have sys_language_uid -1 assigned to them.
    Every productProperty has a relation to a propertyGroup. PropertyGroups are translated.

    The issue is that propertyGroups are now just displayed in default language in the frontend.
    But when a productProperty is translated, the assigned propertyGroup will now also be translated in the frontend.

    Another wiered behaviour in this context: The record product has categories, which are translated and also have a relation to propertyGroups. If the propertyGroup assigned to the productProperty is also assigned to the product category, the translation for propertyGroup will be correctly overlayed.

    It seems like extbase can not handle translations of relations, which “parents” have sys_language_uid set to -1.

  2. Benni Mack commented and changed status New On Hold <span data-processor="relativetime" data-value="2025-03-25T19:34:43+00:00" > 03/25/25, 19:34 </span>

    Hey,

    I assume these are two cases:

    First: We have a “problem” with type=category… that means “MM”.

    “my record with L=-1” -> MM -> category EN
    “my record with L=-1” -> MM -> category NO

    Alexander, the second issue of your is probably a type=select, correct? Is this MM or not? Because then it’s a different issue.

    All I can say is: There is currently a discrepancy on how to retrieve and persist data in the DB. Until this is not clear, we cannot fix extbase because we first need a reliable DB state we can work on a create tests.

  3. Daniel Siepmann commented <span data-processor="relativetime" data-value="2025-04-14T05:52:04+00:00" > 04/14/25, 05:52 </span>

    I guess we run into the same issue for single select.
    Feel free to say otherwise, and I’ll open a dedicated issue.

    Given:
    1. fallbackType: strict and fallbacks: ''
    2. We have an event record in default + translation.
    3. This references another event record (related event), which only exists in default.
    4. This related event references a location.
    5. This location exists in default + translation.
    6. The initial event also references this location.

    Result:
    The initial event will have the default language location, instead of translated locaiton.

    Reason:
    1. Extbase will switch language to default in order to fetch the relations of the related event.
    2. Extbase will store the found location for default language in persistence session.
    3. Extbase will lookup the location of initial event via its UID in persistence session.

    DataMapper->mapObjectToClassProperty() does not handle the language, only uid. The quirk happening before will result in a state where the method will fetch the wrong instance.

    Also DataMapper->mapSingleRow() stores the objects within the persistence session. It already has a comment and references https://review.typo3.org/c/Packages/TYPO3.CMS/+/75093 / #97926.

    The issue on our end (for easier lookup and testing of TYPO3 patches): “Aufgabe #11799 Übersetzungen Veranstaltungsorte”

  4. Garvin Hicking commented <span data-processor="relativetime" data-value="2025-04-14T07:29:53+00:00" > 04/14/25, 07:29 </span>

    This feels vaguely familiar, could it be this:

    https://review.typo3.org/c/Packages/TYPO3.CMS/+/89084

    It’s actually intended that relations are stored with the UID of the base language uid, not the localized uid.

  5. Daniel Siepmann commented <span data-processor="relativetime" data-value="2025-04-14T14:09:27+00:00" > 04/14/25, 14:09 </span>

    That’s not the issue. The issue is the persistence manager where the localized version is not being looked up respecting the language, as they are stored with a lanugage specific identifier in DataMapper->mapSingleRow().

    This is a side effect of the two different code parts, combined with localized and none localized records, with references to the same localized record.

  6. Gerrit Code Review pushed patch set 1 for main to change 92743 status On Hold Under Review <span data-processor="relativetime" data-value="2026-02-08T12:43:35+00:00" > 02/08/26, 12:43 </span>

  7. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-02-26T11:00:09+00:00" > 02/26/26, 11:00 </span>

    Applied in changeset commit:f9ecc6eb2e334a52e38b8bfeecb9c193d2654e49.