Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.749
diff -u -p -r1.749 comment.module
--- modules/comment/comment.module	4 Aug 2009 06:53:48 -0000	1.749
+++ modules/comment/comment.module	5 Aug 2009 16:42:27 -0000
@@ -572,7 +572,7 @@ function comment_node_view($node, $build
  * @param $node
  *  A node object.
  */
-function comment_node_page_additions($node) {
+function comment_node_page_additions($node, $form = TRUE) {
   $additions = array();
 
   // Only attempt to render comments if the node has visible comments.
@@ -590,7 +590,7 @@ function comment_node_page_additions($no
   }
 
   // Append comment form if needed.
-  if (user_access('post comments') && $node->comment == COMMENT_NODE_OPEN && (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_BELOW) == COMMENT_FORM_BELOW)) {
+  if ($form && user_access('post comments') && $node->comment == COMMENT_NODE_OPEN && (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_BELOW) == COMMENT_FORM_BELOW)) {
     $build = drupal_get_form('comment_form', (object) array('nid' => $node->nid));
     $additions['comment_form'] = $build;
   }
@@ -1061,13 +1061,7 @@ function comment_node_delete($node) {
 function comment_node_update_index($node) {
   $text = '';
   if ($node->comment != COMMENT_NODE_HIDDEN) {
-    $comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = :nid AND status = :status', array(
-      ':nid' => $node->nid,
-      ':status' => COMMENT_PUBLISHED
-    ));
-    foreach ($comments as $comment) {
-      $text .= '<h2>' . check_plain($comment->subject) . '</h2>' . check_markup($comment->comment, $comment->format, '', FALSE);
-    }
+    $text = drupal_render(comment_node_page_additions($node));
   }
   return $text;
 }
