Breaks cron job, and maybe some batches.

Operations should be initialized, like this:

[...]
function taxonomy_orphanage_roundup($progressive = TRUE, $limit = -1) {
  $batch = array(
    'title' => t('Collecting orphans'),
    'file' => drupal_get_path('module', 'taxonomy_orphanage') . '/taxonomy_orphanage.batch.inc',
    'finished' => 'taxonomy_orphanage_batch_finished',
    'operations' => array(),
  );
[...]

Comments

elliotttf’s picture

Status: Needs review » Fixed

Thanks for the fix!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

gaëlg’s picture

Issue summary: View changes

I still had a problem with this, so I also added:

  if (empty($batch['operations'])) {
    return;
  }

Before:

  batch_set($batch);
gaëlg’s picture

Actually this is because my Simpletest batch launches a cron task which calls taxonomy_orphanage_cron() which launches a batch. A batch inside another batch: too weird to work well...