Skip to content
Snippets Groups Projects
Commit de978649 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #456722 by akahn: use format_plural() on node delete.

parent b166ca9b
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -634,10 +634,13 @@ function node_multiple_delete_confirm(&$form_state, $nodes) {
}
$form['operation'] = array('#type' => 'hidden', '#value' => 'delete');
$form['#submit'][] = 'node_multiple_delete_confirm_submit';
return confirm_form($form,
t('Are you sure you want to delete these items?'),
'admin/content/node', t('This action cannot be undone.'),
t('Delete all'), t('Cancel'));
$confirm_question = format_plural(count($nodes),
'Are you sure you want to delete this item?',
'Are you sure you want to delete these items?');
return confirm_form($form,
$confirm_question,
'admin/content/node', t('This action cannot be undone.'),
t('Delete'), t('Cancel'));
}
function node_multiple_delete_confirm_submit($form, &$form_state) {
......@@ -645,7 +648,10 @@ function node_multiple_delete_confirm_submit($form, &$form_state) {
foreach ($form_state['values']['nodes'] as $nid => $value) {
node_delete($nid);
}
drupal_set_message(t('The items have been deleted.'));
$message = format_plural(count($form_state['values']['nodes']),
'The item has been deleted.',
'The items have been deleted.');
drupal_set_message($message);
}
$form_state['redirect'] = 'admin/content/node';
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment