From 95023b8c1314374d8dda9d7b8dcead5a946b12b0 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 28 Mar 2009 18:09:11 +0000 Subject: #297972 by scor, yched, Steven Jones, and heyrocker: Allow drupal_execute() to be performed within batch API (with tests). --- includes/form.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/form.inc b/includes/form.inc index 2713e9e87..8e57737fd 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -856,7 +856,10 @@ function form_execute_handlers($type, &$form, &$form_state) { foreach ($handlers as $function) { if (drupal_function_exists($function)) { - if ($type == 'submit' && ($batch =& batch_get())) { + // Check to see if a previous _submit handler has set a batch, but + // make sure we do not react to a batch that is already being processed + // (for instance if a batch operation performs a drupal_execute()). + if ($type == 'submit' && ($batch =& batch_get()) && !isset($batch['current_set'])) { // Some previous _submit handler has set a batch. We store the call // in a special 'control' batch set, for execution at the correct // time during the batch processing workflow. -- cgit v1.2.3