Browse Source

Merge pull request #435 from nigelgbanks/7.x-redirect-to-primary-on-ingest

Redirect the user to the primary object when the ingest form submits, rather than the last object created.
pull/437/head
Morgan Dawe 11 years ago
parent
commit
089a67146c
  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