diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-02-22 15:38:52 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-02-22 15:38:52 +0000 |
commit | 32c34106dc98e288687cff933373e164cfc47563 (patch) | |
tree | 832749f155dd3485ccfa6834924e0a3d485a78be /modules/comment/comment.pages.inc | |
parent | 424cc9bbb1f790b0f325067a6b3b29fd765c609e (diff) | |
download | brdo-32c34106dc98e288687cff933373e164cfc47563.tar.gz brdo-32c34106dc98e288687cff933373e164cfc47563.tar.bz2 |
#606608 follow-up by Gábor Hojtsy and sun: Go back to numeric placeholders for comment menu paths for performance.
Diffstat (limited to 'modules/comment/comment.pages.inc')
-rw-r--r-- | modules/comment/comment.pages.inc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/comment/comment.pages.inc b/modules/comment/comment.pages.inc index 2ad1c77a4..4156beb18 100644 --- a/modules/comment/comment.pages.inc +++ b/modules/comment/comment.pages.inc @@ -103,13 +103,16 @@ function comment_reply($node, $pid = NULL) { /** * Menu callback; publish specified comment. * - * @param $comment - * A comment object. + * @param $cid + * A comment identifier. */ -function comment_approve($comment) { - $comment->status = COMMENT_PUBLISHED; - comment_save($comment); +function comment_approve($cid) { + if ($comment = comment_load($cid)) { + $comment->status = COMMENT_PUBLISHED; + comment_save($comment); - drupal_set_message(t('Comment approved.')); - drupal_goto('node/' . $comment->nid); + drupal_set_message(t('Comment approved.')); + drupal_goto('node/' . $comment->nid); + } + return MENU_NOT_FOUND; } |