Content translation source is not taken into account for paragraphs in case of translation of host entity.

Created on 14 July 2022, over 2 years ago
Updated 24 January 2024, 11 months ago

Problem/Motivation

I have content type with paragraph reference field.
I can create node with en-int original language and de translation
Then if I want to create de-DE translation based on de, I can select translation source language on translation edit form. In such case new translation will be based on selected language, but paragraph translations are based on original language.

Steps to reproduce

  1. Create translatable paragraph type
  2. Create translatable content type with paragraph reference field
  3. Enable 3 languages
  4. Create node with default language 1
  5. Add translation to language 2 and translate paragraphs too
  6. Add translation to language 3 based on language 2
  7. Check if default values of paragraph widget based on language 1 translation

Proposed resolution

In entity_reference_revisions_entity_revision_create we can check if entity has content_translation_source field and try to load source language translation of the target entity to use as source for new translation

🐛 Bug report
Status

Active

Version

1.11

Component

Code

Created by

🇹🇭Thailand vladimir.krupin

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.

  • 🇷🇺Russia kala4ek 🇷🇺 Novosibirsk

    Updated patch to be applicable for 1.11 version.

  • 🇷🇺Russia kala4ek 🇷🇺 Novosibirsk

    Updated patch that works with nested paragraphs too.

  • Status changed to Needs work 19 days ago
  • 🇷🇺Russia zniki.ru

    Thanks for your patches, but please use MR approach instead of patch.
    You can update existing MR #12, or create new one.
    And it would be great if you can provide functional test to cover this issue.

  • 🇷🇺Russia zniki.ru

    nikolay shapovalov changed the visibility of the branch 8.x-1.x to hidden.

  • 🇷🇺Russia zniki.ru

    I tried to replicate this issue, and I wasn't able.
    Drupal 11 latest, paragraphs latest.
    On step 6, I have dropdown "Source language: language 1" and I can change source from language 1 (default value) to language 2.
    Then values from language 2 translation used.

    Can you please provide more information?
    Did you mark field node->paragraph translatable?

    I found at documentation page :

    Never enable translation on the Paragraphs field (Entity reference revisions), as it will enable adding new paragraphs while translating, even if an empty field (not containing any paragraph field) is on the translation source node - which is not supported!

Production build 0.71.5 2024