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. 6
      includes/ingest.form.inc

6
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); islandora_ingest_form_execute_consecutive_callback_steps($form, $form_state, $step);
} }
// Ingest the objects. // Ingest the objects.
$set_redirect = TRUE;
foreach ($form_state['islandora']['objects'] as &$object) { foreach ($form_state['islandora']['objects'] as &$object) {
try { try {
islandora_add_object($object); islandora_add_object($object);
// 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}"; $form_state['redirect'] = "islandora/object/{$object->id}";
$set_redirect = FALSE;
}
drupal_set_message( drupal_set_message(
t('"@label" (ID: @pid) has been ingested.', array('@label' => $object->label, '@pid' => $object->id)), t('"@label" (ID: @pid) has been ingested.', array('@label' => $object->label, '@pid' => $object->id)),
'status'); 'status');

Loading…
Cancel
Save