Translating Nested Paragraphs with Paragraph Group Module Deletes Source Entity's Paragraphs

Created on 21 October 2024, 2 months ago

Problem/Motivation

With the paragraph_group module enabled, when i try to translate a node with nested paragraphs, the source language node and the translation end up with an empty paragraph field.

Steps to reproduce

- have the paragraph_group module enabled
- Have a content type with the field "layout" from paragraph group module.
- This layout paragraph has the field_group_paragraphs where i can add "panel" paragraph reference
- "Panel" paragraph has a field "field_panel_paragraphs" that can reference multiple custom paragraphs.
- Now create content on this node with a paragraph with text for example.
- Translate this node with ai_translate
- See that the translation has no paragraph and the source language node has lost its paragraphs as well.

Proposed resolution

Improve the "setValue()" method in "web/modules/contrib/ai/modules/ai_translate/src/Plugin/FieldTextExtractor/ReferenceFieldExtractor.php" To handle correctly nested paragraphs.z

🐛 Bug report
Status

Active

Version

1.0

Component

Other Submodules

Created by

🇧🇪Belgium arwillame

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @arwillame
  • Merge request !212Draft: 1.0.x → (Open) created by arwillame
  • Pipeline finished with Success
    2 months ago
    Total: 166s
    #316009
  • Pipeline finished with Failed
    2 months ago
    Total: 205s
    #317214
  • Pipeline finished with Failed
    2 months ago
    Total: 197s
    #317285
  • 🇪🇸Spain interdruper

    The problem arises even if Paragraph Group module is not used, but just using nested paragraphs with paragraph fields.
    For me is a major problem since it implies loss of content when nested paragraphs are used.
    I can confirm that your patch in #2 fixes the problem in my case.

  • 🇬🇧United Kingdom MrDaleSmith

    Knocking back to needs work because tests are failing (Coding Standards) and MR is still marked as draft.

Production build 0.71.5 2024