Deleted Paragraphs visible in drag & drop

Created on 29 August 2017, over 7 years ago
Updated 9 February 2023, about 2 years ago

Problem/Motivation

If i click delete on a Paragraph, it is then visible as a first item in drag & drop mode.

Proposed resolution

Hide it in drag & drop mode.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

1.0

Component

User interface

Created by

πŸ‡¨πŸ‡­Switzerland miro_dietiker Switzerland

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡·πŸ‡΄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.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    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

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Patch Failed to Apply
  • πŸ‡¦πŸ‡ΊAustralia paulabg
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    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
  • πŸ‡¨πŸ‡­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:

    1. Delete a paragraph (other than the first paragraph).
    2. Add a new paragraph.
    3. Enter drag and drop mode (and see that the deleted paragraph has replaced the first paragraph).
    4. Exit drag & drop mode and save the node.
    5. 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.

Production build 0.71.5 2024