Commit df492f35 authored by Dries's avatar Dries
Browse files

- Patch #43622 / #46627 by markus: 'delete the selected posts' operation on...

- Patch #43622 / #46627 by markus: 'delete the selected posts' operation on admin/node doesn't work.
parent b28f48dc
......@@ -866,9 +866,6 @@ function node_menu($may_cache) {
'access' => user_access('administer nodes'));
$items[] = array('path' => 'admin/node/overview', 'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/node/action', 'title' => t('content'),
'callback' => 'node_admin_nodes',
'type' => MENU_CALLBACK);
if (module_exist('search')) {
$items[] = array('path' => 'admin/node/search', 'title' => t('search'),
......@@ -1121,7 +1118,12 @@ function node_admin_nodes_submit($form_id, $edit) {
function node_admin_nodes_validate($form_id, $edit) {
$edit['nodes'] = array_diff($edit['nodes'], array(0));
if (count($edit['nodes']) == 0) {
form_set_error('', t('Please select some items to perform the update on.'));
if ($edit['operation'] == 'delete') {
form_set_error('', t('Please select some items to perform the delete operation.'));
}
else {
form_set_error('', t('Please select some items to perform the update on.'));
}
}
}
......@@ -1129,7 +1131,7 @@ function node_admin_nodes() {
global $form_values;
$output = node_filter_form();
if ($_POST['edit']['operation'] == 'delete') {
if ($_POST['edit']['operation'] == 'delete' && $_POST['edit']['nodes']) {
return node_multiple_delete_confirm();
}
......@@ -1161,7 +1163,7 @@ function node_admin_nodes() {
$form['pager'] = array('#value' => theme('pager', NULL, 50, 0));
$form['#method'] = 'post';
$form['#action'] = url('admin/node/action');
$form['#action'] = url('admin/node');
// Call the form first, to allow for the form_values array to be populated.
$output .= drupal_get_form('node_admin_nodes', $form);
......
......@@ -866,9 +866,6 @@ function node_menu($may_cache) {
'access' => user_access('administer nodes'));
$items[] = array('path' => 'admin/node/overview', 'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/node/action', 'title' => t('content'),
'callback' => 'node_admin_nodes',
'type' => MENU_CALLBACK);
if (module_exist('search')) {
$items[] = array('path' => 'admin/node/search', 'title' => t('search'),
......@@ -1121,7 +1118,12 @@ function node_admin_nodes_submit($form_id, $edit) {
function node_admin_nodes_validate($form_id, $edit) {
$edit['nodes'] = array_diff($edit['nodes'], array(0));
if (count($edit['nodes']) == 0) {
form_set_error('', t('Please select some items to perform the update on.'));
if ($edit['operation'] == 'delete') {
form_set_error('', t('Please select some items to perform the delete operation.'));
}
else {
form_set_error('', t('Please select some items to perform the update on.'));
}
}
}
......@@ -1129,7 +1131,7 @@ function node_admin_nodes() {
global $form_values;
$output = node_filter_form();
if ($_POST['edit']['operation'] == 'delete') {
if ($_POST['edit']['operation'] == 'delete' && $_POST['edit']['nodes']) {
return node_multiple_delete_confirm();
}
......@@ -1161,7 +1163,7 @@ function node_admin_nodes() {
$form['pager'] = array('#value' => theme('pager', NULL, 50, 0));
$form['#method'] = 'post';
$form['#action'] = url('admin/node/action');
$form['#action'] = url('admin/node');
// Call the form first, to allow for the form_values array to be populated.
$output .= drupal_get_form('node_admin_nodes', $form);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment