function field_defaults_batch_finished in Field Defaults 8
Same name and namespace in other branches
- 7.2 field_defaults.module \field_defaults_batch_finished()
- 7 field_defaults.module \field_defaults_batch_finished()
The batch finish handler.
2 string references to 'field_defaults_batch_finished'
- FieldDefaultsBulkCommands::fieldDefaultsBulkUpdate in src/
Commands/ FieldDefaultsBulkCommands.php - Bulk update defaults.
- _field_defaults_ui_submit in ./
field_defaults.module - Submit handler for field ui form.
File
- ./
field_defaults.module, line 196 - Allows updating existing content with default values.
Code
function field_defaults_batch_finished($success, $results, $operations) {
if ($success) {
$message = \Drupal::translation()
->formatPlural(count($results), 'Default values were updated for one entity.', 'Default values were updated for @count entities.');
}
else {
$message = t('Finished with an error.');
}
\Drupal::messenger()
->addMessage($message);
}