function cer_batch_update_existing_finished in Corresponding Entity References 7.2
Same name and namespace in other branches
- 7.3 cer.module \cer_batch_update_existing_finished()
- 7 cer.module \cer_batch_update_existing_finished()
Batch 'finished' callback.
1 string reference to 'cer_batch_update_existing_finished'
- cer_update_form_submit in ./
cer.admin.inc - The update form. Allows updating of current entitys.
File
- ./
cer.module, line 259 - Main module file.
Code
function cer_batch_update_existing_finished($success, $results, $operations) {
if ($success) {
$message = format_plural($results['count'], '1 entity processed.', '@count entities processed.');
if (isset($results['errors'])) {
$type = 'warning';
foreach ($results['errors'] as $e) {
drupal_set_message($e
->getMessage(), 'error');
}
}
else {
$type = 'status';
}
drupal_set_message($message, $type);
}
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[0], TRUE);
drupal_set_message($message, 'error');
}
}