summaryrefslogtreecommitdiff
path: root/includes/batch.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/batch.inc')
-rw-r--r--includes/batch.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/includes/batch.inc b/includes/batch.inc
index c489f9301..22692f0ad 100644
--- a/includes/batch.inc
+++ b/includes/batch.inc
@@ -179,8 +179,10 @@ function _batch_process() {
include_once($current_set['file']);
}
- $finished = TRUE;
$task_message = '';
+ // We assume a single pass operation and set the completion level
+ // to 1 by default.
+ $finished = 1;
if ((list($function, $args) = reset($current_set['operations'])) && function_exists($function)) {
// Build the 'context' array, execute the function call,
// and retrieve the user message.
@@ -189,9 +191,9 @@ function _batch_process() {
call_user_func_array($function, array_merge($args, array(&$batch_context)));
}
- if ($finished == TRUE) {
+ if ($finished == 1) {
// Make sure this step isn't counted double when computing $current.
- $finished = FALSE;
+ $finished = 0;
// Remove the operation and clear the sandbox.
array_shift($current_set['operations']);
$current_set['sandbox'] = array();