You are here

function taxonomy_xml_batch_import_finished in Taxonomy import/export via XML 7

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

Finalization callback when a round is done.

3 string references to 'taxonomy_xml_batch_import_finished'
taxonomy_xml_add_term_to_batch_queue in ./taxonomy_xml.process.inc
Manage batch queues by dividing them into recursive 'rounds'.
taxonomy_xml_invoke_service_request in ./taxonomy_xml.process.inc
Make a request on a remote taxonomy server and process the response
url_taxonomy_service_form_submit in services/url.taxonomy_service.inc
What to do when loading from this service

File

./taxonomy_xml.process.inc, line 1124
The workhorse processes for importing taxonomies.

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, array(), WATCHDOG_INFO);
  drupal_set_message($message);
}