You are here

function taxonomy_xml_batch_import_finished in Taxonomy import/export via XML 6

Same name and namespace in other branches
  1. 6.2 taxonomy_xml.module \taxonomy_xml_batch_import_finished()
  2. 7 taxonomy_xml.process.inc \taxonomy_xml_batch_import_finished()

Finalization callback when a round is done.

1 string reference to 'taxonomy_xml_batch_import_finished'
taxonomy_xml_add_term_to_batch_queue in ./taxonomy_xml.module
Manage batch queues by dividing them into recursive 'rounds'.

File

./taxonomy_xml.module, line 1309
taxonomy_xml.module This module makes it possible to import and export taxonomies as XML documents.

Code

function taxonomy_xml_batch_import_finished($success, $results, $operations) {
  if ($success) {
    $message = t("Completed a batch round #%batch_count. %count items processed.", array(
      '%count' => count($results),
      '%batch_count' => $_SESSION['taxonomy_xml_batch_count'],
    ));
    foreach ($results as $tid => $term_name) {
      $message .= " " . l($term_name, 'taxonomy/term/' . $tid);
    }
  }
  else {

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