From b42aeaffdcc6bed2c7a56a8aff44adca48473c5a Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 10 Dec 2013 05:46:23 +0100 Subject: [PATCH] Redirect the user to the primary object when the ingest form submits, rather than the last object created. --- includes/ingest.form.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index b49556d7..89376f7d 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -769,10 +769,16 @@ function islandora_ingest_form_submit(array $form, array &$form_state) { islandora_ingest_form_execute_consecutive_callback_steps($form, $form_state, $step); } // Ingest the objects. + $set_redirect = TRUE; foreach ($form_state['islandora']['objects'] as &$object) { try { islandora_add_object($object); - $form_state['redirect'] = "islandora/object/{$object->id}"; + // We want to redirect to the first object as it's considered to be the + // primary object. + if ($set_redirect) { + $form_state['redirect'] = "islandora/object/{$object->id}"; + $set_redirect = FALSE; + } drupal_set_message( t('"@label" (ID: @pid) has been ingested.', array('@label' => $object->label, '@pid' => $object->id)), 'status');