I have a module with batch operations, this is my hook_menu
$items['some-pretty-url'] = array(
'title' => 'Title',
'page callback' => 'drupal_get_form',
'page arguments' => array('import_form'),
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM,
);
...and this is my batch config
$batch = array(
'title' => t('Lorem ipsum Elit pariatur Duis et elit aute.'),
'init_message' => t('Commencing...'),
'operations' => $operations,
'progress_message' => t('Processed: @current out of @total.'),
'error_message' => t('An error occurred during processing.'),
'finished' => '_import_finished',
);
Batch works pretty good if I have the module definition in the .module file, but if I move the functions to another file the batch simply does not work at all.
$items['some-pretty-url'] = array(
'title' => 'Title',
'page callback' => 'drupal_get_form',
'page arguments' => array('import_form'),
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM,
'file' => 'module_definition.inc', //move module to another file
);
$batch = array(
'title' => t('Lorem ipsum Elit pariatur Duis et elit aute.'),
'init_message' => t('Commencing...'),
'operations' => $operations,
'progress_message' => t('Processed: @current out of @total.'),
'error_message' => t('An error occurred during processing.'),
'finished' => '_import_finished',
'file' => 'module_definition.inc', //batch functions are here
);
Batch function is not being called even if I set the file argument in the batch configuration.