You are here

function node_revision_delete_batch_finish in Node Revision Delete 7.2

Same name and namespace in other branches
  1. 7.3 node_revision_delete.batch.inc \node_revision_delete_batch_finish()

Batch 'finished' callback.

2 string references to 'node_revision_delete_batch_finish'
drush_node_revision_delete in ./node_revision_delete.drush.inc
Implements drush_COMMANDFILE_COMMANDNAME().
node_revision_delete_form_submit in ./node_revision_delete.admin.inc
Form submit handler for the settings form.

File

./node_revision_delete.batch.inc, line 44
Batch API callbacks for node_revision_delete module.

Code

function node_revision_delete_batch_finish($success, $results, $operations) {
  if ($success) {
    foreach ($results as $nid => $count) {
      drupal_set_message(t('Deleted @count revisions for node with nid @nid.', array(
        '@count' => $count,
        '@nid' => $nid,
      )));
    }
  }
  else {

    // An error occurred.
    // $operations contains the operations that remained unprocessed.
    $error_operation = reset($operations);
    $message_variables = array(
      '%error_operation' => $error_operation[0],
      '@arguments' => print_r($error_operation[1], TRUE),
    );
    $message = t('An error occurred while processing %error_operation with arguments: @arguments', $message_variables, TRUE);
    drupal_set_message($message, 'error');
  }
}