From 7f8e9ff0a3932f8439b33c7f94cbdfa56dd6fa70 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Wed, 15 May 2013 14:49:37 +0200 Subject: [PATCH] Moving backwards though the form now brings the user to the expected step. There was a mistake where a step was reverting its global changes before it was actually selected as the previous step. Innocuous enough but it had strange side effects on the global storage, since the step list would be rebuild with this information, steps could insert themselves as previous steps even if they weren't used by the user. --- includes/ingest.form.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index a2d5a833..2312273b 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -534,7 +534,7 @@ function islandora_ingest_form_previous_button(array &$form_state) { $prev_form_step = islandora_ingest_form_get_previous_form_step($form_state); $form_id = $prev_form_step['form_id']; $submit_callback = $form_id . '_undo_submit'; - $submit = function_exists($submit_callback) ? array($submit_callback, 'islandora_ingest_form_previous_submit') : array('islandora_ingest_form_previous_submit'); + $submit = function_exists($submit_callback) ? array('islandora_ingest_form_previous_submit', $submit_callback) : array('islandora_ingest_form_previous_submit'); return array( '#type' => 'submit', '#value' => t('Previous'), @@ -731,7 +731,7 @@ function &islandora_ingest_form_get_objects(array &$form_state) { */ function islandora_ingest_form_get_object(array &$form_state) { $objects = &islandora_ingest_form_get_objects($form_state); - return current($objects); + return reset($objects); } /**