From d443a7c3e88c3ae5c2b6f8eaec2ff088a15a1ec7 Mon Sep 17 00:00:00 2001 From: Brandon Weigel Date: Mon, 5 Mar 2018 18:28:52 +0000 Subject: [PATCH] Turn list of pids_to_delete into an array, and correct warning text --- includes/orphaned_objects.inc | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/includes/orphaned_objects.inc b/includes/orphaned_objects.inc index 460fc3c0..f651f4f2 100644 --- a/includes/orphaned_objects.inc +++ b/includes/orphaned_objects.inc @@ -20,18 +20,28 @@ function islandora_manage_orphaned_objects_form($form, $form_state) { if (isset($form_state['show_confirm'])) { $pids = $form_state['pids_to_delete']; if (count($form_state['pids_to_delete']) <= 10) { - $pid_paths = ''; } $form['confirm_message'] = array( '#type' => 'item', '#markup' => format_plural(count($form_state['pids_to_delete']), 'Are you sure you want to delete this object? This action cannot be reversed.', - 'Are you sure you want to delete these @count objects? This action cannot be reversed.') . $pid_paths, + 'Are you sure you want to delete these @count objects? This action cannot be reversed.'), ); + if (count($pids) <= 10) { + $form['pids_to_delete'] = array( + '#type' => 'markup', + '#theme' => 'item_list', + '#list_type' => 'ol', + ); + $options = array('attributes' => array('target' => '_blank')); + foreach ($pids as $pid) { + $form['pids_to_delete']['#items'][] = l($pid, "/islandora/object/{$pid}", $options); + } + } $form['confirm_submit'] = array( '#type' => 'submit', '#value' => t('Confirm'), @@ -45,8 +55,10 @@ function islandora_manage_orphaned_objects_form($form, $form_state) { ); } else { - drupal_set_message(t('Some objects may intentionally have no parents. If deleting objects, please be - absolutely sure that these objects are no longer required.'), 'warning'); + drupal_set_message(t('This page lists objects that have at least one parent, according to their RELS-EXT, that does not + exist in the Fedora repository. These orphans might exist due to a failed batch ingest, their parents being deleted, + or a variety of other reasons. Some of these orphans may exist intentionally. + Please be cautious when deleting, as this action is irreversible.'), 'warning'); $orphaned_objects = islandora_get_orphaned_objects(); $rows = array(); foreach ($orphaned_objects as $orphaned_object) { @@ -81,6 +93,7 @@ function islandora_manage_orphaned_objects_form($form, $form_state) { } return $form; } + /** * Validation for the Islandora Orphaned Objects management form. *