I have created a batch, and it's working, but I want to control the messaging a little better. I would like to give the user some feedback about the currently executing operation, other than just letting them know that it has completed.
Here is what I am attempting to do, but it is still executing sleep(5)
before updating the message.
function batch_callback(&$context) {
// set up message for batch operation
if (empty($context['sandbox'])) {
$context['message'] = t('Pre-execution message...');
$context['finished'] = FALSE;
// put something in sandbox (doesn't matter what)
$context['sandbox']['step'] = 1;
return;
}
sleep(5);
$context['finished'] = TRUE;
}
So, how do I set a pre-execution batch message?