diff options
Diffstat (limited to 'includes/batch.inc')
-rw-r--r-- | includes/batch.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/batch.inc b/includes/batch.inc index 4010acb36..ada7ce8b3 100644 --- a/includes/batch.inc +++ b/includes/batch.inc @@ -34,6 +34,11 @@ function _batch_page() { ':token' => drupal_get_token($_REQUEST['id'])) )->fetchField(); + if (!$batch) { + drupal_set_message(t('No active batch.'), 'error'); + drupal_goto(); + } + $batch = unserialize($batch); // Register database update for the end of processing. @@ -409,7 +414,7 @@ function _batch_finished() { // We get here if $form['#redirect'] was FALSE, or if the form is a // multi-step form. We save the final $form_state value to be retrieved // by drupal_get_form(), and redirect to the originating page. - $_SESSION['batch_form_state'] = $_batch['form_state']; + drupal_set_session('batch_form_state', $_batch['form_state']); drupal_goto($_batch['source_page']); } } |