Difference between the 'Paragraphs (stable)' widget and the 'Paragraphs Legacy Asymmetric' widget

Created on 5 January 2024, 12 months ago
Updated 15 August 2024, 4 months ago

Problem/Motivation

I've been using this module on my site and I'm noticing some strange behavior when using the 'Paragraphs (stable)' widget. I'm not sure if it is intended or not. It has to do with duplicate data in the database (there seems to be a lot of discussion related to duplicate data after reading through the issue queue...but I'm not sure if what I'm seeing is related to that or not).

So I have a content type that contains a paragraph field (which contains a few fields including a date field). My site contains 2 languages (English and Spanish).

If I create a node (in English), and I fill out the paragraph fields, I get 1 entry in the database in my paragraph__field_date table. The langcode correctly shows en for this entry. Now if I translate that node to Spanish and save, I now have 3 entries in the database. 2 of them show a langcode of en, and the other shows a langcode of es. I just don't understand where this duplicate English entry comes from? Or what its purpose is?

If I go back into the English version of the node and update it, I can see one of the database entries change. The duplicate one does not change though. The problem is now I have this random duplicate entry in the database that isn't used anywhere.

if I use the 'Paragraphs Legacy Asymmetric' widget instead and follow the above steps, I correctly only see 2 entries in the database, and they update correctly if they are changed.

Does anyone know if that duplicate entry is intended? The module page says both widgets can be used when using this module, but it seems that the 'Paragraphs Legacy Asymmetric' widget is the one that should be used?

Can anyone let me know if perhaps I'm not understanding something correctly here? Thanks!

💬 Support request
Status

Needs review

Version

1.3

Component

Documentation

Created by

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

Comments & Activities

  • Issue created by @tlo405
  • Hey all, just posting again here. I've been considering deleting all paragraphs (and nodes of the node type that uses them) and re-importing after I switch from the 'Paragraphs (stable)' widget to the 'Paragraphs Legacy Asymmetric' widget. However that is slightly risky...if there is a good reason for those duplicates I mentioned above to exist (perhaps something with revisions), I will keep using the 'stale' widget.

    I have a block on my site that was using an entity query to get these paragraphs...however that query was returning the duplicates. I was able to work around that problem.... but I just don't think those duplicates should exist at all.

  • 🇹🇼Taiwan peterwcm

    The Paragraphs Legacy Asymmetric widget changes the original language and removes other translations after creating a duplicate of paragraphs. However, the same logic is not found in the hook_entity_translation_create hook, which is used by the Paragraphs (stable) widget. I have copied the same logic to the hook, which seems to remove the redundant data created during the paragraph clone.

    Does anyone know why the logic is not added, I wonder if it's on purpose or a mistake.

  • Status changed to Needs review 4 months ago
Production build 0.71.5 2024