Nested paragraphs - content lost starting with second nesting level

Created on 4 March 2025, about 1 month ago

Problem/Motivation

First off: Thank you for you quick support in 💬 Support for nested paragraphs translation Active and sorry for not testing any earlier! You were too fast :-)
I installed 1.3.2 and I indeed see a big improvement.
Headings of accordions (directly nested paragraphs) now get proper translations, yay!
However, their respective content, which is a second field (a reference to another paragraph) in the nested paragraph, has its actual text disappearing.
So the structure looks like this:

  • Parent node
    • Accordion paragraph (first nesting level)
      • Accordion title (text field) - gets translated successfully
      • Accordion content paragraph (second nesting level; reference to a paragraph; one of four types)
        • Actual accordion type's content (links, text editor, etc.) - content gets lost during auto translation

This is how the backend/editor view looks like for this structure

Steps to reproduce

Create several levels of nested paragraphs (references to references (to references ...) of paragraphs)
Add content
Add translation
Content gets removed starting with the second nesting level

Apart from that, I see HTML tags in translated content - will open another issue for this ( 🐛 Markup lost/literal HTML tags visible Active )

🐛 Bug report
Status

Active

Version

1.3

Component

Code

Created by

🇦🇹Austria tgoeg

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

Comments & Activities

  • Issue created by @tgoeg
  • 🇮🇹Italy bigbabert Milano, Italy
    • alaindessi committed 811a14f7 on 1.0.x
      Issue #3510878 by tgoeg, bigbabert: Nested paragraphs - content lost...
  • 🇮🇹Italy bigbabert Milano, Italy

    Hi @tgoeg,

    fixed and tested in 1.3.3, please feel free to re-open if you still find issues now infinite nested paragraphs should be supported plus multi fields.

    Best regards

  • 🇮🇹Italy bigbabert Milano, Italy
  • 🇦🇹Austria tgoeg

    This seems to be fixed, yes! Thanks a lot!

    I fixed the issue below by correctly configuring the translatable paragraphs as per https://www.drupal.org/docs/contributed-modules/paragraphs/multilingual-... (I had some unsupported fields checked, which I removed, and then had to select a "dummy" field ("Authored on") to enable translations of nested paragraphs as these were the only (untranslatable) fields in these paragraphs).
    Still, I don't understand how this could have worked with other languages I haven't used <1.3.3 on before, but that's irrelevant.
    I am leaving this here if anyone runs into the same problem:

    ==

    I still see the same behavior for one node I used auto_translate <1.3.3 on before (which did not work with nested paragraphs).
    The referenced nested paragraphs are simply gone when I try to add a translation (to the same language I tried before with <1.3.3 which seemed to have corrupted the translation).

    I tried the following to bring back the ability to translate them:

    • Rebuilt cache
    • Reinstalled the module
    • Reverted to an older revision of the node (in its original language)
    • Made a change to the paragraphs and saved them (in the node's original language)
    • Uninstalled the module and tried to add a translation (even then I get the same "no paragraphs added yet"; I can't even add or delete one, regardless of the module being installed or not)
    • Truncated the key_value_expire table (as I assumed there might be some unsaved change from before that causes it)
    • Used another user to try it
    • Added some dummy value in the target language in paragraph__field_text_editor_field in the DB (still not shown when editing the node; another reference to the actual paragraph seems to be missing as well)

    Nothing helped, this one node seemingly has some lingering defective translation data somewhere in the DB. I couldn't quite get down to the actual relations and where this dangling (NULL) reference is.

    See the solution at the very top for how I fixed this.

Production build 0.71.5 2024