function _node_mass_update_batch_finished

Same name in other branches
  1. 7.x modules/node/node.admin.inc \_node_mass_update_batch_finished()
  2. 9 core/modules/node/node.admin.inc \_node_mass_update_batch_finished()
  3. 8.9.x core/modules/node/node.admin.inc \_node_mass_update_batch_finished()
  4. 11.x core/modules/node/node.admin.inc \_node_mass_update_batch_finished()

Implements callback_batch_finished().

Reports the 'finished' status of batch operation for node_mass_update().

Parameters

bool $success: A boolean indicating whether the batch mass update operation successfully concluded.

string[] $results: An array of rendered links to nodes updated via the batch mode process.

array $operations: An array of function calls (not used in this function).

See also

_node_mass_update_batch_process()

File

core/modules/node/node.admin.inc, line 164

Code

function _node_mass_update_batch_finished($success, $results, $operations) {
    if ($success) {
        \Drupal::messenger()->addStatus(t('The update has been performed.'));
    }
    else {
        \Drupal::messenger()->addError(t('An error occurred and processing did not complete.'));
        $message = \Drupal::translation()->formatPlural(count($results), '1 item successfully processed:', '@count items successfully processed:');
        $item_list = [
            '#theme' => 'item_list',
            '#items' => $results,
        ];
        $message .= \Drupal::service('renderer')->render($item_list);
        \Drupal::messenger()->addStatus($message);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.