Commit 3ae534a6 authored by Dries's avatar Dries

- Patch #28595 by Cvbge: fixed problems with bulk comment operations.

parent ac3b446e
......@@ -1007,20 +1007,20 @@ function comment_delete($cid) {
function comment_operations($action = NULL) {
if ($action == 'publish') {
$operations = array(
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = COMMENT_PUBLISHED WHERE cid = %d'),
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
);
}
else if ($action == 'unpublish') {
$operations = array(
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = COMMENT_NOT_PUBLISHED WHERE cid = %d'),
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
);
}
else {
$operations = array(
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = COMMENT_PUBLISHED WHERE cid = %d'),
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = COMMENT_NOT_PUBLISHED WHERE cid = %d'),
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
);
}
......@@ -1052,7 +1052,7 @@ function comment_admin_overview($type = 'new') {
// load the comments that we want to display
$status = ($type == 'approval') ? COMMENT_NOT_PUBLISHED : COMMENT_PUBLISHED;
$result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = '. db_escape_string($status));
$result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = '. $status);
// build a table listing the appropriate comments
$destination = drupal_get_destination();
......
......@@ -1007,20 +1007,20 @@ function comment_delete($cid) {
function comment_operations($action = NULL) {
if ($action == 'publish') {
$operations = array(
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = COMMENT_PUBLISHED WHERE cid = %d'),
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
);
}
else if ($action == 'unpublish') {
$operations = array(
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = COMMENT_NOT_PUBLISHED WHERE cid = %d'),
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
);
}
else {
$operations = array(
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = COMMENT_PUBLISHED WHERE cid = %d'),
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = COMMENT_NOT_PUBLISHED WHERE cid = %d'),
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
);
}
......@@ -1052,7 +1052,7 @@ function comment_admin_overview($type = 'new') {
// load the comments that we want to display
$status = ($type == 'approval') ? COMMENT_NOT_PUBLISHED : COMMENT_PUBLISHED;
$result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = '. db_escape_string($status));
$result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = '. $status);
// build a table listing the appropriate comments
$destination = drupal_get_destination();
......
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