- π·π΄Romania bogdan.dinu
The getChildParagraphs method in src/Plugin/Field/FieldWidget/ParagraphsWidget.php reconstructs the paragraphs from the form state storage but it doesn't take into account deleted paragraphs.
I added a simple check to fix the issue.I changed the issue priority to major because clicking "Complete drag & drop" will restore the deleted paragraph which creates data inconsistency.
- last update
over 1 year ago Patch Failed to Apply - π¦πΊAustralia paulabg
While debugging the patch mentioned in comment #2, I discovered that the value of $child_field_item_state['mode'] was 'remove' instead of 'removed'. I updated the patch with this new change, tested it, and it appears to be working as intended
- last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago 180 pass - π¦πΊAustralia paulabg
While debugging the patch mentioned in comment #2, I discovered that the value of $child_field_item_state['mode'] was 'remove' instead of 'removed'. I updated the patch with this new change, tested it, and it appears to be working as intended
- Status changed to Needs work
over 1 year ago 8:10am 10 August 2023 - π¨πSwitzerland miro_dietiker Switzerland
Thank you for picking this up.
I see the argument around the status change. But given that this bug affected no one enough to engage since 2017 makes me feel it can't be that major.
Happy to fix it, thx for the work.
Now we need test coverage for future QA (and also for easier review now). - πΊπΈUnited States mikemccaffrey
I'm going to say that this is a critical bug, since it seems to have been causing content loss for the site we have been working on.
Here are the steps that caused the issue:
- Delete a paragraph (other than the first paragraph).
- Add a new paragraph.
- Enter drag and drop mode (and see that the deleted paragraph has replaced the first paragraph).
- Exit drag & drop mode and save the node.
- The first paragraph is deleted from the page (or at least the relationship is deleted in the reference field table).
The patch from #5 seems to prevent that issue from happening.