summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-10-12 00:54:08 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-10-12 00:54:08 -0400
commit3d1be9b5ca8cf7baadeb2e86665c080526d805cf (patch)
treeb5858dba12b203000fb2e661a4c86d28644c8905 /includes
parent890d98ac96b578206733236ecc23acaf57585454 (diff)
downloadbrdo-3d1be9b5ca8cf7baadeb2e86665c080526d805cf.tar.gz
brdo-3d1be9b5ca8cf7baadeb2e86665c080526d805cf.tar.bz2
Issue #2342667 by claudiu.cristea, Dave Reid, ndobromirov: Cron and batch processing of queues are not accepting callables
Diffstat (limited to 'includes')
-rw-r--r--includes/batch.inc4
-rw-r--r--includes/common.inc4
2 files changed, 4 insertions, 4 deletions
diff --git a/includes/batch.inc b/includes/batch.inc
index 061acd4c6..e89ab8dec 100644
--- a/includes/batch.inc
+++ b/includes/batch.inc
@@ -460,10 +460,10 @@ function _batch_finished() {
if (isset($batch_set['file']) && is_file($batch_set['file'])) {
include_once DRUPAL_ROOT . '/' . $batch_set['file'];
}
- if (function_exists($batch_set['finished'])) {
+ if (is_callable($batch_set['finished'])) {
$queue = _batch_queue($batch_set);
$operations = $queue->getAllItems();
- $batch_set['finished']($batch_set['success'], $batch_set['results'], $operations, format_interval($batch_set['elapsed'] / 1000));
+ call_user_func($batch_set['finished'], $batch_set['success'], $batch_set['results'], $operations, format_interval($batch_set['elapsed'] / 1000));
}
}
}
diff --git a/includes/common.inc b/includes/common.inc
index e863f411f..5268fd830 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5380,12 +5380,12 @@ function drupal_cron_run() {
// Do not run if queue wants to skip.
continue;
}
- $function = $info['worker callback'];
+ $callback = $info['worker callback'];
$end = time() + (isset($info['time']) ? $info['time'] : 15);
$queue = DrupalQueue::get($queue_name);
while (time() < $end && ($item = $queue->claimItem())) {
try {
- $function($item->data);
+ call_user_func($callback, $item->data);
$queue->deleteItem($item);
}
catch (Exception $e) {