When creating new translation with paragraphs field in preview or closed mode, noticed it does not use the correct source on nested paragraphs

Created on 5 May 2022, over 2 years ago
Updated 12 September 2024, 2 months ago

Problem/Motivation

While using nested paragraphs structure and working with new content translations noticed that the nested paragraphs form, displayed and used an unexpected language source.

Structure

  1. Create a paragraph: Book
    • Add field 'title' of type "Text (plain)" to paragraph book, check "Users may translate this field"
  2. Create a paragraph: library
    • Add a field 'title' of type "Text (plain)" to paragraph library, check "Users may translate this field"
    • Add a field 'books' of type "Entity reference revisions" to paragraph library which reference Book paragraphs type only, unlimited, check "Users may translate this field"
  3. Setup Basic Page content type
    • Add a field 'paragraphs' of type "Entity reference revisions" to the basic page content type which reference Library paragraphs type only, unlimited, check "Users may translate this field"
    • Go to manage form display of basic page content type /admin/structure/types/manage/page/form-display
    • Set paragraphs field setting 'edit mode' to 'preview'
    • Save
  4. Go to /admin/config/regional/language setup Basic Languages
    • Add France language with code language 'fr'
    • Add Custom language with code language 'en-gb'
  5. Go to /admin/config/regional/content-language
    • In custom language settings check 'Content' and 'Paragraph'
    • Check 'Basic page' content type as translatable and all properties and fields
    • Check 'Library' paragraph type as translatable and all properties and fields
    • Check 'Book' paragraph type as translatable and all properties and fields
    • Save

Steps to reproduce

  1. Create a basic page content
    • Set title to 'Base US'
    • Set a Library paragraph with 'Library US' as title
    • In Library paragraph set Book paragraph with 'Book US' as title
  2. Add translation 'en-gb' to 'Base US' content from english source
    • Set title to 'Translation UK'
    • Set a Library paragraph with 'Library UK' as title
    • In Library paragraph set Book paragraph with 'Book UK' as title
  3. Try add translation 'fr' to 'Base US' content from English source
    • On create translation form don't try to edit the paragraphs and observe
    • Notice that the library title is 'Library US' and the book title is 'Book US'
    • Now switch the language source to en-gb
    • Notice that the library title is 'Library UK' and the book title is 'Book US'
    • When instead of 'Book US' it should display 'Book UK'
    • If you save the form 'Book US' value will be used
    • It seems this happens in nested paragraph levels whenever edit mode is 'preview' or 'closed'.
    • If edit mode is set to 'open' this doesn't happen.

Versions

  • drupal/core: 9.3.12
  • drupal/paragraphs: 1.14
πŸ› Bug report
Status

Active

Version

1.14

Component

Code

Created by

πŸ‡¨πŸ‡΄Colombia jaenalexander

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.

Production build 0.71.5 2024