From 482c9e6999e1eabf0e01d67cbf59305089d9bc21 Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Tue, 20 Mar 2018 18:45:11 +0000 Subject: [PATCH] Add error message for delete failure --- includes/orphaned_objects.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/orphaned_objects.inc b/includes/orphaned_objects.inc index 1e063ffb..502177f9 100644 --- a/includes/orphaned_objects.inc +++ b/includes/orphaned_objects.inc @@ -243,7 +243,13 @@ function islandora_delete_orphaned_objects_batch_operation($pids, &$context) { '@total' => $context['sandbox']['total'], )); islandora_delete_object($target_object); - $context['results']['success'][] = $target_pid; + $object_check = islandora_object_load($target_pid); + if ($object_check) { + drupal_set_message(t('Could not delete ' . $target_pid . '. You may not have permission to manage this object.'), 'error'); + } + else { + $context['results']['success'][] = $target_pid; + } $context['sandbox']['progress']++; } $context['finished'] = ($context['sandbox']['total'] == 0) ? 1 : ($context['sandbox']['progress'] / $context['sandbox']['total']);