It’s me again. Here’s the situation:

I create a new node in English and add a text paragraph. After saving the node, I create a German translation and translate the paragraph content.

Later, in the frontend, I realize that I need an additional paragraph. So I use the Add function provided by Frontend Editing to create a new text paragraph in English.

When I then switch to German in the frontend to translate this newly added paragraph, and save it, the paragraph ends up having the same content in both languages. No separate translation is created, unlike the behavior in the backend.

The edit form from the paragraph_edit module handles exactly this case in its init() method. However, this method is never called in this frontend editing workflow.

The reason seems to be the line $form_state->set('entity_form_initialized', TRUE); in FrontendEditingFormBuilder::buildEditForm(). Since I don’t know why this was introduced, I have not provided a fix yet, but this logic should not be executed for paragraphs, as it prevents proper translation handling.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

refs created an issue. See original summary.

a.dmitriiev’s picture

Thank you @refs for finding this. Paragraphs translation is a very sensitive topic. Could you please give more details? What type of translation do you have: sync or async? I mean is your paragraph field marked as translatable or not? From what you described it seems that it is not, but just to confirm.

refs’s picture

Paragraph version is 1.20 on a current Drupal 10.6. We do not use any async stuff or other widgets. The paragraph fields are not translatable.

One questions about https://www.drupal.org/project/frontend_editing/issues/3560907. Unfortunately, I haven't had time to look at it yet, but I'll try to get to it next week. I'm only asking because it's now closed (fixed) but not merged, if I understand correctly.

a.dmitriiev’s picture

The code from https://www.drupal.org/project/frontend_editing/issues/3560907 should be included in 2.0.0-beta10 and it was also backported to 1.9.0.

And here is the MR: https://git.drupalcode.org/project/frontend_editing/-/merge_requests/149 . It is shown as Merged.

stborchert made their first commit to this issue’s fork.

stborchert’s picture

Version: 2.0.0-beta10 » 2.x-dev
Status: Active » Needs review

We had this problem also. When creating a paragraph in a content translation the paragraph gets the default language instead of the current language.
The changes introduced in MR !162 fixes this for us.

a.dmitriiev’s picture

Status: Needs review » Needs work

Thank you @stborchert for moving this issue further. Please check my questions in the MR, I have some concerns about the changes that were done

stborchert’s picture

Status: Needs work » Needs review
stborchert’s picture

I've updated MR!162 to fix a small error in FieldReferenceHelper.

a.dmitriiev’s picture

Hi @stborchert,

Unfortunately the changes from your MR are not fixing the reported issue for me. When the paragraph is created in default language with Frontend Editing and then I try to edit the translation, it still edits the source entity.

I have tried to check myself and I tried a bit different approach, see MR here https://git.drupalcode.org/project/frontend_editing/-/merge_requests/165... . I tried to use content_translation module as much as possible.

a.dmitriiev’s picture

Issue tags: +Chicago2026
stborchert’s picture

I had a quick look onto it and it looks much cleaner than our approach.
Will try to test this ... thanks!

hanan alasari’s picture

Assigned: Unassigned » hanan alasari
hanan alasari’s picture

Test setup

- Host content is translatable
- Paragraphs reference field is not translatable
- A new paragraph is added through Frontend Editing on the default language version

Steps to reproduce

1. Create content in the default language with a paragraph.
2. Add a translation for the content.
3. Return to the default language frontend page.
4. Add a new paragraph using Frontend Editing.
5. Open the translated version.
6. Edit/translate the newly added paragraph.

Before the fix
Editing the newly added paragraph in the translated version also affected the source/default language content.

After the fix
The newly added paragraph keeps separate values per language as expected, and editing the translation no longer affects the source entity.

Result
RTBC from my side.

hanan alasari’s picture

Status: Needs review » Reviewed & tested by the community
hanan alasari’s picture

Assigned: hanan alasari » Unassigned
stborchert’s picture

@hanan-alasari Which MR did you test? Did you see comment #11?

hanan alasari’s picture

that’s the one — I tested MR !165. and after applying the fix branch the translation worked correctly.
https://git.drupalcode.org/project/frontend_editing/-/merge_requests/165...

a.dmitriiev’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.