Issue Bug Resolved

#103970Inline relations do not set the actual language

Daniel Siepmann 06/04/24, 06:10 updated 10/17/26, 12:35

Description

Steps to reproduce:

  1. Create a site with at least two language
  2. Create a page within the site
  3. Create a content element in default language (don’t save yet)
  4. Switch language of content element to all languages (-1) (don’t save yet)
  5. Attach a file relation and save.

Result:
The relation will be saved with 0 for languages, which can be confirmed by select sys_language_uid from sys_file_reference once saved.

Expected:
The relation will be saved with -1 for language, as that’s what was chosen in the parent while creating the relation.

Reviews 5

History 1533

Show 8 earlier messages
  1. Daniel Siepmann commented <span data-processor="relativetime" data-value="2024-06-04T06:27:07+00:00" > 06/04/24, 06:27 </span>

    It seems the context provided in AJAX is already wrong JSON.parse(JSON.parse(this.createRequestBody(t)['ajax[context]'])['config']) reveals the original instead of current language.
    This is then returned from AJAX request and rendered within the form, leading to the value being submitted to DataHandler on save.

  2. Daniel Siepmann commented <span data-processor="relativetime" data-value="2024-06-04T08:33:35+00:00" > 06/04/24, 08:33 </span>

    Our suggestion: Adjust the context to use the actual currently selected language.
    Also on every update of the parent language, update all inline language values to match the parent.

  3. Sybille Peters commented <span data-processor="relativetime" data-value="2024-12-20T07:32:41+00:00" > 12/20/24, 07:32 </span>

    I can also reproduce this with the other way around:

    1. Create a content element of type textmedia
    2. In CE, set to language -1, save
    3. Add image (field “assets”), save
    4. Set CE set language to 0, save
    5. Now look at the entry in the DB, the entry in sys_file_reference will be with -1, the entry in the content element will be with 0
    6. Now translate the element (connected mode)
    7. Open the translated element: you will see 2 file reference, one of them is dimmed (this is the sys_file_reference=-1 one from the CE in orginal language) and one of them is the copied element.

    And I think this is the same root cause as #88980 with the additional problem that in #88980 allowLanguageSynchronization is set to true and then the images in the default language are copied on translate.

    You can find existing records like this:

    select r.uid,t.pid,r.pid,r.sys_language_uid,t.sys_language_uid,t.header from sys_file_reference r inner join tt_content t on r.uid_foreign=t.uid where not r.deleted and not r.hidden and r.sys_language_uid=-1 and r.tablenames='tt_content' and r.sys_language_uid!=t.sys_language_uid order by r.pid,r.uid;

    or just search for mismatch in sys_language_uid:

    select r.uid,t.pid,r.pid,r.sys_language_uid,t.sys_language_uid,t.header from sys_file_reference r inner join tt_content t on r.uid_foreign=t.uid where not r.deleted and not r.hidden and r.tablenames='tt_content' and r.sys_language_uid!=t.sys_language_uid order by r.pid,r.uid;
  1. Sybille Peters commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-17T12:35:14+00:00" > 10/17/26, 12:35 </span>

    Applied in changeset commit:c4c5e37ff8f8d7ef215a16228c47006ad844a346.