1 file.module file_type_classify_finished($success, $results, $operations)

Batch 'finished' callback.

See also

file_type_classify_batch()

file_needs_type_classification()

File

core/modules/file/file.module, line 3408
Defines a "managed_file" Form API field and a "file" field for Field module.

Code

function file_type_classify_finished($success, $results, $operations) {
  if ($success) {
    $message = format_plural(count($results), 'One file processed.', '@count files processed.');
    backdrop_set_message($message);
    file_needs_type_classification(FALSE);
  }
  else {
    // An error occurred.
    $error_operation = reset($operations);
    backdrop_set_message(
    t('An error occurred while processing @operation with arguments : @args', 
    array(
      '@operation' => $error_operation[0],
      '@args' => print_r($error_operation[0], TRUE),
    )
    )
    );
  }
}