Problems with multilingual entities

Created on 9 May 2016, almost 9 years ago
Updated 13 December 2023, over 1 year ago

Steps to reproduce:

1. Create new entity browser for media entity bundles with images type provider
2. Add Entity reference field to the translatable node type
3. Select Entity browser widget for entity reference field and attach created entity browser
4. Create new content and upload image via Entity browser field, specify alt and title attributes for image
5. Add translation for created content
6. Try to overwrite entity browser's image attributes to new language (create translation for referenced media entity)
As result, it does not create new translation for referenced media entity

UPD:
Fast Fix PR:
https://github.com/drupal-media/entity_browser/pull/150

🐛 Bug report
Status

Needs review

Version

2.0

Component

Widget plugins

Created by

🇩🇪Germany Oleksandr Ivanchenko

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • 🇧🇾Belarus dewalt

    Updated #56 patch to use with latest module version.

  • Status changed to Needs work over 1 year ago
  • 🇬🇷Greece bserem

    @dewalt I assume you meant patch 59 was the source, as there is no patch in 56, and 56 is just a typo mistake.

  • 🇷🇴Romania ita08

    I made a patch to address an issue where the language code was always taken from the current language, ignoring the 'langcode' query parameter in the request.

    in EntityBrowserController.php, on line 66:
    $langcode = $this->languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId();
    I updated this line with:

     $langcode = $request->query->get('langcode') ? $request->query->get('langcode') : $this->languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId();
    

    The patch now checks if a 'langcode' is provided in the query; if so, it uses that value, otherwise it falls back to the current language.

    If the langcode is always taken from the current language, this lead to issues that when editing an entity reference, it does not load the content in the translation language.

Production build 0.71.5 2024