Child paragraphs are always created in English

Created on 29 September 2021, about 3 years ago
Updated 13 January 2024, 12 months ago

Problem/Motivation

It seems like the widget is always creating the child paragraphs in English, regardless of the form language it's being loaded in.

Steps to reproduce

- Set up the widget on a translatable node. Allow the editors to choose the node language on the node form.
- Open the node form. Choose a non-English language in the main node form
- Add a paragraph inside your paragraph field that is using Layout Paragraph's widget.
- Save the node form
- Inspect your DB table `paragraphs_item_field_data` and check the latest item created.

Expected result:
The paragraph entity is created in the same langcode as the host node

Actual result:
The paragraph entity is created in English

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇪🇸Spain marcoscano Barcelona, Spain

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.

  • Hello @justin2pin
    This issue has not been resolved yet. I have same config as #4 and I still have issues translating a child paragraph.

    I have a paragraph of type X with a field that references to many paragraphs of type Y. My site's default language is English and I have one foreign language which is Spanish. It happens when I first create a node in spanish, and I usually fill all the fields on paragraph of type X and its children paragraphs of type Y, then I translate the node to English and translate all fields particularly those of the child paragraph Y. And i save. When I come back to the spanish version, I find that the spanish values of the fields contained in pargraph Y were overriden by the english values.

Production build 0.71.5 2024