Don't show orphan paragraphs on the usage page

Created on 17 March 2018, almost 7 years ago
Updated 20 March 2023, almost 2 years ago

Problem/Motivation

Currently paragraph entities are not deleted when a host entity removes the field item, or even when host entities are deleted.

This leads to 2 issues:
- Usage records pointing to "orphan" paragraph entities are left in the database
- The list usage page shows those entities in the UI

I believe the first issue should be fixed in paragraphs/entity_reference_revisions (there's a billion issues about it already), but we should at least make sure the orphan/garbage usage in the DB is not shown to users.

Proposed resolution

While building the usage page, if the source entity is a paragraph, only show the usage if the parent exists and it's still referencing the paragraph.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇪🇸Spain marcoscano Barcelona, Spain

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.

  • 🇦🇲Armenia arthur.baghdasar

    We need this functionality, since the orphan handling implementation is going to be addressed in 3.x version.
    I've re-rolled the patch

  • 🇪🇸Spain marcoscano Barcelona, Spain

    Hello @arthur.baghdasar, this issue is fixed and closed since a long time ago. The 2.x branch does not display orphan paragraphs on the usage listing page. Feel free to open a new bug report if you experience is different than that.
    Thanks!

Production build 0.71.5 2024