When an entity gets deleted from the system, queues aren't aware and continue to reference the now deleted item.

I have created a patch (attached) which implements an entity delete hook and checks appropriate queues based on entity type and bundle for the deleted entity and removes the reference.

The patch is for the 8.x version. The issue would still exist in the 7.x version, therefore needing to be back-ported at some point.

Comments

mlanth created an issue. See original summary.

nlisgo’s picture

Status: Active » Reviewed & tested by the community

This is exactly what I need.

I think the only way to improve this patch is with a test but there seems to be a lack of tests for entityqueue :(

  • amateescu committed 616118b on 8.x-1.x authored by mlanth
    Issue #2826630 by mlanth: Entity deletion does not remove the reference...
amateescu’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new1.84 KB
new3.53 KB

There is a core issue to fix this: #2723323: [META] Clean up references to deleted entities, but until that happens I guess this is the best we can do.

Committed the patch attached to 8.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.