diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-03-28 18:09:11 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-03-28 18:09:11 +0000 |
commit | 95023b8c1314374d8dda9d7b8dcead5a946b12b0 (patch) | |
tree | 43d5c1323df69de9bc4571a8fd90cf94f8e5b7f0 /includes | |
parent | 1c2033f0f88fd42fa30e86f4e03b27262fb49318 (diff) | |
download | brdo-95023b8c1314374d8dda9d7b8dcead5a946b12b0.tar.gz brdo-95023b8c1314374d8dda9d7b8dcead5a946b12b0.tar.bz2 |
#297972 by scor, yched, Steven Jones, and heyrocker: Allow drupal_execute() to be performed within batch API (with tests).
Diffstat (limited to 'includes')
-rw-r--r-- | includes/form.inc | 5 |
1 files changed, 4 insertions, 1 deletions
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. |