summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc5
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.