When using nested paragraphs where the parent field and nested field are the same, drag & drop ordering of the parent paragraph item can set the wrong weights for sibling and child paragraph items. The order class in this case is the same for all of the items. Example:

Field on content types: field_paragraphs

Paragraphs Bundle "Content" also has field_paragraphs but with different bundles allowed

Creating a node with a paragraph type "Content" and adding a nested paragraph type from the "Content" bundle results in the bug reordering items due to the order class being based on the field name, i.e. field-paragraphs-delta-order

Patch adds the value of the $table_id variable to the order class to make it unique.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blake.thompson created an issue. See original summary.

Stolkmachine’s picture

Status: Active » Reviewed & tested by the community

Tested this with multiple items in multiple levels of nesting. Re-ordered the items, saved and re-opened. I was not able to break the order anymore.

recrit’s picture

Version: 7.x-1.0-rc4 » 7.x-1.x-dev
FileSize
789 bytes

This is present in the latest dev too. Re-rolled the patch against the latest 7.x-1.x.

recrit’s picture

updated the patch to keep the no new line at end of the file.

Sneakyvv’s picture

Thanks for the patch @recrit! I confirm it works!

Islanderweedy’s picture

#4 works for me

  • jeroen.b committed 01a30dc on 7.x-1.x authored by recrit
    Issue #2762309 by recrit, blake.thompson: Drag...
jeroen.b’s picture

Status: Reviewed & tested by the community » Fixed

Thanks. Pushed!

Sneakyvv’s picture

Since the patch is not yet included in the latest release, here is the patch which can be applied to 7.x-1.0-rc5.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

drikc’s picture

I applied the patch here but it didn't solve the weight sorting saving I was facing. So I made another issue here #2923638: Nested paragraphs doesn't save their weight sorting with a solution and it looks like with both patch the nested paragraphs items ordering issue is solved.