Browse Source

Redirect the user to the primary object when the ingest form submits,

rather than the last object created.
pull/435/head
Nigel Banks 11 years ago
parent
commit
b42aeaffdc
  1. 8
      includes/ingest.form.inc

8
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');

Loading…
Cancel
Save