You are here

function taxonomy_xml_batch_import_finished in Taxonomy import/export via XML 6.2

Same name and namespace in other branches
  1. 6 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.

2 string references 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'.
taxonomy_xml_invoke_service_request in ./taxonomy_xml.module
Make a request on a remote taxonomy server and process the response

File

./taxonomy_xml.module, line 2158
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. %count items processed.", array(
      '%count' => count($results),
    ));
    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);
    watchdog('taxonomy_xml', "Batch error " . print_r(array(
      $success,
      $results,
      $operations,
    ), 1), array(), WATCHDOG_ERROR);
  }
  watchdog('taxonomy_xml', $message);
  drupal_set_message($message);
}