Relationships are not updated when a node is deleted or unpublished as a target

Created on 12 June 2025, 23 days ago

Problem/Motivation

When a node is deleted or its status is updated (e.g., published/unpublished), the related data in the custom Entity Mesh table is correctly updated only when the node is a source in the relationship. However, when the node is a target in such relationships, the data is not updated accordingly.

This results in outdated or broken references in the mesh data structure, especially when:

  • A node is deleted — links pointing to it should be marked as broken.
  • A node's status is changed — particularly if the content becomes inaccessible to anonymous users, relationships may need to be adjusted to reflect access constraints.

This leads to inconsistencies in data integrity and potentially impacts content display and relationship navigation for end users.

Steps to reproduce

  1. Create two nodes (Node A and Node B).
  2. Establish a relationship in the Entity Mesh table where Node A is the source and Node B is the target.
  3. Delete Node B or unpublish it.
  4. Observe the Entity Mesh table — the reference to Node B remains unchanged, even though Node B is now inaccessible or nonexistent.

Proposed resolution

Implement logic to update Entity Mesh records where the affected node appears as a target, not just as a source. This involves two scenarios:

On node deletion:

  • Find all mesh relationships where the deleted node is the target.
  • Mark those relationships as broken .

On node status update (published/unpublished):

  • Check if the node becomes inaccessible to anonymous users.
  • If so, find mesh relationships where this node is the target.
  • Update those relationships to reflect the change, potentially by marking the relationship as "restricted" or adjusting visibility.
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇪🇸Spain lpeidro Madrid

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

Comments & Activities

Production build 0.71.5 2024