Deleting an event leaves date orphans

Created on 23 May 2024, about 1 month ago
Updated 5 June 2024, 23 days ago

Problem/Motivation

We just came across the scenario where a user created an event, then a child date, then deleted the event.

Now when you open the date's detail page, you get a WSOD courtesy of line 416 in openculturas_custom.module (417 in 2.1.x):

assert($event instanceof NodeInterface);

This is of course mitigated by the fact that you need to know the URL of the date; it won't be linked any where on the site.

Proposed resolution

Orphaned date entities should be avoided.
Either the deletion of events which are referenced by dates should not be possible, or deleting such an event should automatically delete those dates as well.

πŸ› Bug report
Status

Active

Version

2.2

Component

User interface

Created by

πŸ‡©πŸ‡ͺGermany mrshowerman Munich

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

Comments & Activities

  • Issue created by @mrshowerman
  • πŸ‡©πŸ‡ͺGermany hexabinaer Berlin, Germany

    This is an unfortunate known issue. To be honest, we didn't take it seriously enough because it appeared during test nodes cleanup. To avoid unintended damage, we introduced the "unpublish" workflow state and restricted the node delete permissions to higher privileged roles.

    But now that the scenario has been reported for the 3rd time already (2 off-platform) we should find a robust solution.

    I am still having a hard time understanding the user story that makes people delete a (reusable) event description. Understanding the situation would help deciding upon one of the possible solutions.

    By the way, the solution must handle any entities that are referenced by a mandatory field as well. Plus cleanup of non-mandatory fields like article "mentions" references.

    The decision is to be made between these 2 principles

    - Disallow deletion with reference to dependencies (feedback information page lists referencing nodes linked)
    - Bulk deletion based on dependency detection (confirmation page lists current and referencing nodes, confirmation option complete - or cancel)

  • πŸ‡©πŸ‡ͺGermany mrshowerman Munich

    I know this is a tough one.
    We used the Entity Reference Integrity β†’ module in one of our projects in order to deny people from deleting nodes that are still referenced somewhere.
    But I have to admit that this introduced so many problems (e.g. false positives) that we decided to remove the module again.

Production build 0.69.0 2024