From 5c85f607bb80e1693dab4be4ec3c91df472e7275 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Fri, 17 Nov 2017 09:54:14 -0400 Subject: [PATCH] Handle derivatives of itself. (#696) * Handle derivatives of itself. * More legibility. --- includes/delete_datastream.form.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/delete_datastream.form.inc b/includes/delete_datastream.form.inc index 9d736982..6d67c8dd 100644 --- a/includes/delete_datastream.form.inc +++ b/includes/delete_datastream.form.inc @@ -74,7 +74,7 @@ function islandora_datastream_to_purge(AbstractObject $object, $dsid) { $hooks = islandora_invoke_hook_list(ISLANDORA_DERIVATIVE_CREATION_HOOK, $object->models, array($object)); $hook_filter = function ($hook_def) use ($dsid) { return isset($hook_def['source_dsid']) && isset($hook_def['destination_dsid']) ? - $hook_def['source_dsid'] == $dsid : + ($hook_def['source_dsid'] == $dsid && $hook_def['destination_dsid'] != $dsid) : FALSE; }; $hooks = array_filter($hooks, $hook_filter);