? drupal-comment-paths.patch
Index: modules/comment/comment.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.admin.inc,v
retrieving revision 1.34
diff -u -p -r1.34 comment.admin.inc
--- modules/comment/comment.admin.inc	10 Oct 2009 13:37:07 -0000	1.34
+++ modules/comment/comment.admin.inc	16 Oct 2009 19:14:07 -0000
@@ -90,7 +90,7 @@ function comment_admin_overview($form, &
       'author' => theme('username', array('account' => $comment)),
       'posted_in' => l($comment->node_title, 'node/' . $comment->nid),
       'changed' => format_date($comment->changed, 'short'),
-      'operations' => l(t('edit'), 'comment/edit/' . $comment->cid, array('query' => $destination)),
+      'operations' => l(t('edit'), 'comment/' . $comment->cid .'/edit', array('query' => $destination)),
     );
   }
 
@@ -206,27 +206,6 @@ function comment_multiple_delete_confirm
 }
 
 /**
- * Menu callback; delete a comment.
- *
- * @param $cid
- *   The comment to be deleted.
- */
-function comment_delete_page($cid = NULL) {
-  $comment = db_query('SELECT c.*, u.name AS registered_name, u.uid FROM {comment} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.cid = :cid', array(':cid' => $cid))->fetch();
-  $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
-  $output = '';
-
-  if (is_object($comment) && is_numeric($comment->cid)) {
-    $output = drupal_get_form('comment_confirm_delete', $comment);
-  }
-  else {
-    drupal_set_message(t('The comment no longer exists.'));
-  }
-
-  return $output;
-}
-
-/**
  * Form builder; Builds the confirmation form for deleting a single comment.
  *
  * @ingroup forms
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.791
diff -u -p -r1.791 comment.module
--- modules/comment/comment.module	16 Oct 2009 15:54:33 -0000	1.791
+++ modules/comment/comment.module	16 Oct 2009 19:14:07 -0000
@@ -166,20 +166,44 @@ function comment_menu() {
     'access arguments' => array('administer comments'),
     'type' => MENU_LOCAL_TASK,
   );
-  $items['comment/delete'] = array(
-    'title' => 'Delete comment',
-    'page callback' => 'comment_delete_page',
-    'access arguments' => array('administer comments'),
+  $items['comment/%comment'] = array(
+    'title' => 'Comment permalink',
+    'page callback' => 'comment_permalink',
+    'page arguments' => array(1),
+    'access arguments' => array('access comments'),
     'type' => MENU_CALLBACK,
-    'file' => 'comment.admin.inc',
   );
-  $items['comment/edit/%comment'] = array(
-    'title' => 'Edit comment',
+  $items['comment/%comment/view'] = array(
+    'title' => 'View comment',
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'weight' => -10,
+  );
+  $items['comment/%comment/edit'] = array(
+    'title' => 'Edit',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('comment_form', 2),
+    'page arguments' => array('comment_form', 1),
     'access callback' => 'comment_access',
-    'access arguments' => array('edit', 2),
-    'type' => MENU_CALLBACK,
+    'access arguments' => array('edit', 1),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 0,
+  );
+  $items['comment/%comment/approve'] = array(
+    'title' => 'Approve',
+    'page callback' => 'comment_approve',
+    'page arguments' => array(1),
+    'access arguments' => array('administer comments'),
+    'type' => MENU_LOCAL_TASK,
+    'file' => 'comment.pages.inc',
+    'weight' => 1,
+  );
+  $items['comment/%comment/delete'] = array(
+    'title' => 'Delete',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('comment_confirm_delete', 1),
+    'access arguments' => array('administer comments'),
+    'type' => MENU_LOCAL_TASK,
+    'file' => 'comment.admin.inc',
+    'weight' => 2,
   );
   $items['comment/reply/%node'] = array(
     'title' => 'Add new comment',
@@ -190,21 +214,6 @@ function comment_menu() {
     'type' => MENU_CALLBACK,
     'file' => 'comment.pages.inc',
   );
-  $items['comment/approve'] = array(
-    'title' => 'Approve a comment',
-    'page callback' => 'comment_approve',
-    'page arguments' => array(2),
-    'access arguments' => array('administer comments'),
-    'type' => MENU_CALLBACK,
-    'file' => 'comment.pages.inc',
-  );
-  $items['comment/%comment'] = array(
-    'title' => 'Comment permalink',
-    'page callback' => 'comment_permalink',
-    'page arguments' => array(1),
-    'access arguments' => array('access comments'),
-    'type' => MENU_CALLBACK,
-  );
 
   return $items;
 }
@@ -870,12 +879,12 @@ function comment_links($comment, $node) 
     if (user_access('administer comments') && user_access('post comments')) {
       $links['comment_delete'] = array(
         'title' => t('delete'),
-        'href' => "comment/delete/$comment->cid",
+        'href' => "comment/$comment->cid/delete",
         'html' => TRUE,
       );
       $links['comment_edit'] = array(
         'title' => t('edit'),
-        'href' => "comment/edit/$comment->cid",
+        'href' => "comment/$comment->cid/edit",
         'html' => TRUE,
       );
       $links['comment_reply'] = array(
@@ -886,7 +895,7 @@ function comment_links($comment, $node) 
       if ($comment->status == COMMENT_NOT_PUBLISHED) {
         $links['comment_approve'] = array(
           'title' => t('approve'),
-          'href' => "comment/approve/$comment->cid",
+          'href' => "comment/$comment->cid/approve",
           'html' => TRUE,
         );
       }
@@ -895,7 +904,7 @@ function comment_links($comment, $node) 
       if (comment_access('edit', $comment)) {
         $links['comment_edit'] = array(
           'title' => t('edit'),
-          'href' => "comment/edit/$comment->cid",
+          'href' => "comment/$comment->cid/edit",
           'html' => TRUE,
         );
       }
Index: modules/comment/comment.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.pages.inc,v
retrieving revision 1.26
diff -u -p -r1.26 comment.pages.inc
--- modules/comment/comment.pages.inc	11 Oct 2009 03:07:17 -0000	1.26
+++ modules/comment/comment.pages.inc	16 Oct 2009 19:14:07 -0000
@@ -103,20 +103,14 @@ function comment_reply($node, $pid = NUL
 /**
  * Menu callback; publish specified comment.
  *
- * @param $cid ID of comment to be published.
+ * @param $comment
+ *   A comment object.
  */
-function comment_approve($cid) {
-  // Load the comment whose cid = $cid
-  if ($comment = comment_load($cid)) {
-    $comment->status = COMMENT_PUBLISHED;
-    $comment->comment_format = $comment->format;
-    comment_save($comment);
+function comment_approve($comment) {
+  $comment->status = COMMENT_PUBLISHED;
+  $comment->comment_format = $comment->format;
+  comment_save($comment);
 
-    drupal_set_message(t('Comment approved.'));
-    drupal_goto('node/' . $comment->nid);
-  }
-  else {
-    drupal_set_message(t('The comment you are approving does not exist.'), 'error');
-    drupal_goto();
-  }
+  drupal_set_message(t('Comment approved.'));
+  drupal_goto('node/' . $comment->nid);
 }
Index: modules/comment/comment.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v
retrieving revision 1.48
diff -u -p -r1.48 comment.test
--- modules/comment/comment.test	16 Oct 2009 13:20:16 -0000	1.48
+++ modules/comment/comment.test	16 Oct 2009 19:14:07 -0000
@@ -111,7 +111,7 @@ class CommentHelperCase extends DrupalWe
    *   Comment to delete.
    */
   function deleteComment($comment) {
-    $this->drupalPost('comment/delete/' . $comment->id, array(), t('Delete'));
+    $this->drupalPost('comment/' . $comment->id . '/delete', array(), t('Delete'));
     $this->assertText(t('The comment and all its replies have been deleted.'), t('Comment deleted.'));
   }
 
@@ -320,7 +320,7 @@ class CommentInterfaceTest extends Comme
     $this->assertEqual(rtrim($comment_loaded->thread, '/') . '.01/', $reply_loaded->thread, t('Thread of second reply grows correctly.'));
 
     // Edit reply.
-    $this->drupalGet('comment/edit/' . $reply->id);
+    $this->drupalGet('comment/' . $reply->id . '/edit');
     $reply = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
     $this->assertTrue($this->commentExists($reply, TRUE), t('Modified reply found.'));
 
@@ -444,7 +444,7 @@ class CommentPreviewTest extends Comment
     $edit['date'] = '2008-03-02 17:23 +0300';
     $expected_date = format_date(strtotime($edit['date']));
     $comment = $this->postComment($this->node, $edit['subject'], $edit['comment'], TRUE);
-    $this->drupalPost('comment/edit/' . $comment->id, $edit, t('Preview'));
+    $this->drupalPost('comment/' . $comment->id . '/edit', $edit, t('Preview'));
 
     // Check that the preview is displaying the subject, comment, author and date correctly.
     $this->assertTitle(t('Preview comment | Drupal'), t('Page title is "Preview comment".'));
@@ -494,7 +494,7 @@ class CommentAnonymous extends CommentHe
     $this->setCommentAnonymous('1');
 
     // Attempt to edit anonymous comment.
-    $this->drupalGet('comment/edit/' . $anonymous_comment1->id);
+    $this->drupalGet('comment/' . $anonymous_comment1->id . '/edit');
     $edited_comment = $this->postComment(NULL, $this->randomName(), $this->randomName());
     $this->assertTrue($this->commentExists($edited_comment, FALSE), t('Modified reply found.'));
     $this->drupalLogout();
Index: modules/comment/comment.tokens.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.tokens.inc,v
retrieving revision 1.5
diff -u -p -r1.5 comment.tokens.inc
--- modules/comment/comment.tokens.inc	11 Oct 2009 03:07:18 -0000	1.5
+++ modules/comment/comment.tokens.inc	16 Oct 2009 19:14:07 -0000
@@ -184,7 +184,7 @@ function comment_tokens($type, $tokens, 
           break;
 
         case 'edit-url':
-          $replacements[$original] = url('comment/edit/' . $comment->cid, array('absolute' => TRUE));
+          $replacements[$original] = url('comment/' . $comment->cid . '/edit', array('absolute' => TRUE));
           break;
 
         // Default values for the chained tokens handled below.
