Commit 54786ec1 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Remove all child artefact_parent_cache records when deleting artefacts

Signed-off-by: default avatarRichard Mansfield <>
parent aaed7856
......@@ -595,6 +595,11 @@ abstract class ArtefactType {
// Delete any references to these artefacts from non-artefact places.
delete_records_select('artefact_parent_cache', "artefact IN $idstr");
// The artefacts should have no 'real' children at this point, but they
// could still be in the artefact_parent_cache as parents if they had
// attachments, or if any of their children had attachments.
delete_records_select('artefact_parent_cache', "parent IN $idstr");
// Make sure that the artefacts are removed from any view blockinstances
if ($records = get_records_sql_array("
SELECT va.block, va.artefact, bi.configdata
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment