Referenced node changes language if different from node with IEF complex form

Created on 13 September 2017, about 7 years ago
Updated 8 November 2023, about 1 year ago

Problem/Motivation

When adding an existing piece of content on a new node with a different default language. IEF is changing the language of the referenced content to the language of the parent content

Steps to reproduce

  1. Create an article content type that is translatable
  2. Add an Entity Reference to the Article that references other articles
  3. Set entity reference field widget to use inline entity form complex
  4. Create an English Article. NOTE: Do not translate english article
  5. Create a dutch article that references the english article. Do not edit the english article when added.
  6. English Article is now only in dutch. No translation is created.

Proposed resolution

IEF should respect the added node's original language unless that node is edited after added.

Remaining tasks

Patch

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇫🇮Finland badrange

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇦Ukraine podarok Ukraine

    needs reroll

    git apply 2908530-12.patch 
    error: patch failed: src/TranslationHelper.php:65
    error: src/TranslationHelper.php: patch does not apply
    error: patch failed: tests/src/FunctionalJavascript/TranslationTest.php:76
    error: tests/src/FunctionalJavascript/TranslationTest.php: patch does not apply
    
  • I can confirm this is still issue. I'm on the latest version ( 2.0.0-rc10 ) and our live site is on D 9.5.11, but I tried this out on a fresh install of drupal 10 (10.1) just to make sure it wasn't just the live site.

    IEF works great on English content only, but with other languages (multi-lingual) there are few issues.

    Basic setup - enable tmgmt module (for translations) and Language module (and create another language). Create a Reference to Content to another Content type. Then create a translation, and on the translated page try to add translated node (or new).

    Oberervations --
    If on the "manage form display" configuration page (/admin/structure/types/manage/CONTENTTYPE/form-display) if I switch the widget from IEF complex or simple back to just "Select List" or "Autocomplete" then it points to where it should (translated node in another language) but going back to IEF will switch it back to default language (in my case english)

    On the translated node's IEF complex form, the options to add another item, or "remove" an existing one are missing, but on English works perfectly.

    Would it help to add images or something? I think maybe team knows exactly how to reproduce by now, maybe I can also look into this one and help, but wasn't sure if this bug is being worked on/already fixed. Any updates on this one?

Production build 0.71.5 2024