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.
Comment | File | Size | Author |
---|---|---|---|
#9 | paragraphs-draggable-fields-2762309-9-RC5.patch | 665 bytes | Sneakyvv |
#4 | paragraphs-draggable-fields-2762309-4.patch | 588 bytes | recrit |
| |||
paragraphs-draggable-fields.patch | 667 bytes | blake.thompson | |
Comments
Comment #2
Stolkmachine CreditAttribution: Stolkmachine at Clockwork commentedTested 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.
Comment #3
recrit CreditAttribution: recrit commentedThis is present in the latest dev too. Re-rolled the patch against the latest 7.x-1.x.
Comment #4
recrit CreditAttribution: recrit commentedupdated the patch to keep the no new line at end of the file.
Comment #5
Sneakyvv CreditAttribution: Sneakyvv at Calibrate for Government of Flanders commentedThanks for the patch @recrit! I confirm it works!
Comment #6
Islanderweedy CreditAttribution: Islanderweedy commented#4 works for me
Comment #8
jeroen.b CreditAttribution: jeroen.b at .VDMi/ commentedThanks. Pushed!
Comment #9
Sneakyvv CreditAttribution: Sneakyvv at Calibrate for Government of Flanders commentedSince the patch is not yet included in the latest release, here is the patch which can be applied to 7.x-1.0-rc5.
Comment #11
drikc CreditAttribution: drikc commentedI 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.