=== modified file 'modules/comment/comment.admin.inc'
--- modules/comment/comment.admin.inc	2009-10-16 21:00:03 +0000
+++ modules/comment/comment.admin.inc	2009-10-18 21:47:59 +0000
@@ -59,7 +59,6 @@ function comment_admin_overview($form, &
   // Load the comments that need to be displayed.
   $status = ($arg == 'approval') ? COMMENT_NOT_PUBLISHED : COMMENT_PUBLISHED;
   $header = array(
-    'subject' => array('data' => t('Subject'), 'field' => 'subject'),
     'author' => array('data' => t('Author'), 'field' => 'name'),
     'posted_in' => array('data' => t('Posted in'), 'field' => 'node_title'),
     'changed' => array('data' => t('Updated'), 'field' => 'changed', 'sort' => 'desc'),
@@ -72,7 +71,7 @@ function comment_admin_overview($form, &
   $query->addField('u', 'name', 'registered_name');
   $query->addField('n', 'title', 'node_title');
   $result = $query
-    ->fields('c', array('subject', 'nid', 'cid', 'comment', 'changed', 'status', 'name', 'homepage'))
+    ->fields('c', array('nid', 'cid', 'timestamp', 'status', 'name', 'homepage'))
     ->fields('u', array('uid'))
     ->condition('c.status', $status)
     ->limit(50)
@@ -86,9 +85,8 @@ function comment_admin_overview($form, &
 
   foreach ($result as $comment) {
     $options[$comment->cid] = array(
-      'subject' => l($comment->subject, 'comment/' . $comment->cid, array('attributes' => array('title' => truncate_utf8($comment->comment, 128)), 'fragment' => 'comment-' . $comment->cid)),
       'author' => theme('username', array('account' => $comment)),
-      'posted_in' => l($comment->node_title, 'node/' . $comment->nid),
+      'posted_in' => l($comment->node_title, 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)),
       'changed' => format_date($comment->changed, 'short'),
       'operations' => l(t('edit'), 'comment/' . $comment->cid .'/edit', array('query' => $destination)),
     );
@@ -140,7 +138,7 @@ function comment_admin_overview_submit($
         // Allow modules to respond to the updating of a comment.
         module_invoke_all('comment_' . $form_state['values']['operation'], $comment);
         // Add an entry to the watchdog log.
-        watchdog('content', 'Comment: updated %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)));
+        watchdog('content', 'Comment: updated %cid.', array('%cid' => $comment->cid), WATCHDOG_NOTICE, l(t('view'), 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)));
       }
     }
     cache_clear_all();
@@ -172,8 +170,7 @@ function comment_multiple_delete_confirm
   foreach (array_filter($edit['comments']) as $cid => $value) {
     $comment = comment_load($cid);
     if (is_object($comment) && is_numeric($comment->cid)) {
-      $subject = db_query('SELECT subject FROM {comment} WHERE cid = :cid', array(':cid' => $cid))->fetchField();
-      $form['comments'][$cid] = array('#type' => 'hidden', '#value' => $cid, '#prefix' => '<li>', '#suffix' => check_plain($subject) . '</li>');
+      $form['comments'][$cid] = array('#type' => 'hidden', '#value' => $cid);
       $comment_counter++;
     }
   }
@@ -215,7 +212,7 @@ function comment_confirm_delete($form, &
   $form['#comment'] = $comment;
   return confirm_form(
     $form,
-    t('Are you sure you want to delete the comment %title?', array('%title' => $comment->subject)),
+    t('Are you sure you want to delete the comment by %name', array('%name' => $comment->name)),
     'node/' . $comment->nid,
     t('Any replies to this comment will be lost. This action cannot be undone.'),
     t('Delete'),

=== modified file 'modules/comment/comment.install'
--- modules/comment/comment.install	2009-10-16 14:00:04 +0000
+++ modules/comment/comment.install	2009-10-18 21:47:59 +0000
@@ -10,6 +10,12 @@
  * Implement hook_uninstall().
  */
 function comment_uninstall() {
+  // Delete comment_body field.
+  field_delete_field('comment_body');
+
+  // Delete comment_subject field.
+  field_delete_field('comment_subject');
+
   // Remove variables.
   variable_del('comment_block_count');
   $node_types = array_keys(node_type_get_types());
@@ -43,6 +49,28 @@ function comment_enable() {
   db_insert('node_comment_statistics')
     ->from($query)
     ->execute();
+
+  // Create comment body field.
+  // @todo this should be done in comment_install, but causes exceptions
+  // in simpletest due to dependencies between entity_get_info() and
+  // taxonomy_install().
+  $field = array(
+    'field_name' => 'comment_body',
+    'object_type' => 'comment',
+    'type' => 'text_long',
+  );
+  field_create_field($field);
+
+  // Create comment subject field.
+  $field = array(
+    'field_name' => 'comment_subject',
+    'object_type' => 'comment',
+    'type' => 'text',
+  );
+  field_create_field($field);
+
+  // Create instances on all existing node types.
+  node_types_rebuild();
 }
 
 /**
@@ -195,7 +223,138 @@ function comment_update_7009() {
 }
 
 /**
- * @} End of "defgroup updates-6.x-to-7.x"
+ * Create the comment_body and comment_subject fields.
+ */
+function comment_update_7010() {
+  $ret = array();
+  // Create comment body field.
+  $field = array(
+    'field_name' => 'comment_body',
+    'type' => 'text_long',
+  );
+  field_create_field($field);
+
+  // Create comment_subject field.
+  $field = array(
+    'field_name' => 'comment_subject',
+    'type' => 'text',
+  );
+  field_create_field($field);
+
+  // Add the fields to comments for all existing bundles.
+  $body_instance = array(
+    'field_name' => 'comment_body',
+    'label' => 'Body',
+    'settings' => array('text_processing' => 1),
+    // Hide field labels by default.
+    'display' => array(
+      'full' => array(
+        'label' => 'hidden',
+      ),
+    ),
+  );
+  $subject_instance = array(
+    'field_name' => 'comment_subject',
+    'label' => 'Subject',
+    // Hide field labels by default.
+    'display' => array(
+      'full' => array(
+        'label' => 'hidden',
+      ),
+    ),
+  );
+  foreach (node_type_get_types() as $info) {
+    $body_instance['bundle'] = 'comment_node_' . $info->type;
+    field_create_instance($body_instance);
+
+    // Only create the subject field if it is enabled for this content type.
+    if (variable_get('comment_subject_field_' . $info->type, TRUE)) {
+      $subject_instance['bundle'] = 'comment_node_' . $info->type;
+      field_create_instance($subject_instance);
+    }
+  }
+
+  return array();
+}
+
+/**
+ * Migrate data from the comment and subject fields to field storage.
+ */
+function comment_update_7011(&$context) {
+  $ret = array();
+
+  // This is a multipass update. First set up some comment variables.
+  if (empty($context['total'])) {
+    $comments = (bool) db_query_range('SELECT 1 FROM {comment}', 0, 1)->fetchField();
+    if (!$comments) {
+      // The update will finish when $context['types'] is an empty array.
+      // Since we have nothing to do if there's no comments on the site, except
+      // drop the columns, set that here for convenience.
+      $context['types'] = array();
+    }
+    else {
+      $context['etid'] = _field_sql_storage_etid('comment');
+      $context['types'] = node_type_get_types();
+    }
+    $context['total'] = count($context['types']);
+  }
+  if (!empty($context['types'])) {
+    $type = array_shift($context['types']);
+
+    $query = db_select('comment', 'c');
+    $query->innerJoin('node', 'n', 'c.nid = n.nid AND n.type = :type', array(':type' => $type->type));
+    $query->addField('c', 'cid', 'entity_id');
+    $query->addExpression("'comment_node_$type->type'", 'bundle');
+    $query->addExpression($context['etid'], 'etid');
+    $query->addExpression('0', 'deleted');
+    $query->addExpression("'" . FIELD_LANGUAGE_NONE . "'", 'language');
+    $query->addExpression('0', 'delta');
+    $query->addField('c', 'comment', 'comment_body_value');
+    $query->addField('c', 'format', 'comment_body_format');
+
+    $comment_body = field_info_field('comment_body');
+    $comment_body_table = _field_sql_storage_tablename($comment_body);
+
+    db_insert($comment_body_table)
+      ->from($query)
+      ->execute();
+
+    $comment_subject = field_info_field('comment_subject');
+    if (variable_get('comment_subject_field_' . $type->type, TRUE)) {
+      // Migrate {comment}.subject to field storage.
+      $query = db_select('comment', 'c');
+      $query->innerJoin('node', 'n', 'c.nid = n.nid AND n.type = :type', array(':type' => $type->type));
+      $query->addField('c', 'cid', 'entity_id');
+      $query->addExpression("'comment_node_$type->type'", 'bundle');
+      $query->addExpression($context['etid'], 'etid');
+      $query->addExpression('0', 'deleted');
+      $query->addExpression("'" . FIELD_LANGUAGE_NONE . "'", 'language');
+      $query->addExpression('0', 'delta');
+      $query->addField('c', 'subject', 'comment_subject_value');
+
+      $comment_subject_table = _field_sql_storage_tablename($comment_subject);
+
+      db_insert($comment_subject_table)
+        ->from($query)
+        ->execute();
+
+      variable_del('comment_subject_field_' . $type->type);
+    }
+  }
+
+  // On the last pass of the update, $context['types'] will be empty.
+  if (empty($context['types'])) {
+    db_drop_field($ret, 'comment', 'comment');
+    db_drop_field($ret, 'comment', 'subject');
+    db_drop_field($ret, 'comment', 'format');
+  }
+
+  $ret['#finished'] = 1 - count($context['types']) / $context['total'];
+
+  return $ret;
+}
+
+/** @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
 
@@ -229,19 +388,6 @@ function comment_schema() {
         'default' => 0,
         'description' => 'The {users}.uid who authored the comment. If set to 0, this comment was created by an anonymous user.',
       ),
-      'subject' => array(
-        'type' => 'varchar',
-        'length' => 64,
-        'not null' => TRUE,
-        'default' => '',
-        'description' => 'The comment title.',
-      ),
-      'comment' => array(
-        'type' => 'text',
-        'not null' => TRUE,
-        'size' => 'big',
-        'description' => 'The comment body.',
-      ),
       'hostname' => array(
         'type' => 'varchar',
         'length' => 128,
@@ -269,13 +415,6 @@ function comment_schema() {
         'size' => 'tiny',
         'description' => 'The published status of a comment. (0 = Not Published, 1 = Published)',
       ),
-      'format' => array(
-        'type' => 'int',
-        'size' => 'small',
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The {filter_format}.format of the comment body.',
-      ),
       'thread' => array(
         'type' => 'varchar',
         'length' => 255,

=== modified file 'modules/comment/comment.module'
--- modules/comment/comment.module	2009-10-17 06:00:07 +0000
+++ modules/comment/comment.module	2009-10-18 21:47:59 +0000
@@ -236,6 +236,37 @@ function comment_count_unpublished() {
  */
 function comment_node_type_insert($info) {
   field_attach_create_bundle('comment', 'comment_node_' . $info->type);
+
+  // Attach the body field by default.
+  $instance = array(
+    'field_name' => 'comment_body',
+    'label' =>'Body',
+    'object_type' => 'comment',
+    'bundle' => 'comment_node_' . $info->type,
+    'settings' => array('text_processing' => 1),
+    // Hide field labels by default.
+    'display' => array(
+      'full' => array(
+        'label' => 'hidden',
+      ),
+    ),
+  );
+  field_create_instance($instance);
+
+  // Attach the subject field by default.
+  $instance = array(
+    'field_name' => 'comment_subject',
+    'label' => 'Subject',
+    'object_type' => 'comment',
+    'bundle' => 'comment_node_' . $info->type,
+    // Hide field labels by default.
+    'display' => array(
+      'full' => array(
+        'label' => 'hidden',
+      ),
+    ),
+  );
+  field_create_instance($instance);
 }
 
 /**
@@ -257,7 +288,6 @@ function comment_node_type_delete($info)
     'comment_default_mode',
     'comment_default_per_page',
     'comment_anonymous',
-    'comment_subject_field',
     'comment_preview',
     'comment_form_location',
   );
@@ -393,15 +423,17 @@ function comment_get_recent($number = 10
   //         and are visible to the current user.
   $nids = db_query_range("SELECT nc.nid FROM {node_comment_statistics} nc WHERE nc.comment_count > 0 ORDER BY nc.last_comment_timestamp DESC", 0, $number)->fetchCol();
 
-  $comments = array();
   if (!empty($nids)) {
     // Step 2: From among the comments on the nodes selected in the first query,
     //         find the $number of most recent comments.
     // Using Query Builder here for the IN-Statement.
     $query = db_select('comment', 'c');
     $query->innerJoin('node', 'n', 'n.nid = c.nid');
+    $query->innerJoin('users', 'u', 'u.uid = c.uid');
+    $query->addField('n', 'title', 'node_title');
+    $query->addExpression('IF(c.uid != 0, u.name, c.name)', 'name');
     return $query
-      ->fields('c', array('nid', 'subject', 'cid', 'created', 'changed'))
+      ->fields('c', array('nid', 'cid', 'uid', 'timestamp'))
       ->condition('c.nid', $nids, 'IN')
       ->condition('c.status', COMMENT_PUBLISHED)
       ->condition('n.status', 1)
@@ -411,7 +443,7 @@ function comment_get_recent($number = 10
       ->fetchAll();
   }
 
-  return $comments;
+  return array();
 }
 
 /**
@@ -474,8 +506,12 @@ function comment_new_page_count($num_com
 function theme_comment_block() {
   $items = array();
   $number = variable_get('comment_block_count', 10);
+
   foreach (comment_get_recent($number) as $comment) {
-    $items[] = l($comment->subject, 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)) . '<br />' . t('@time ago', array('@time' => format_interval(REQUEST_TIME - $comment->changed)));
+    $name = theme('username', $comment);
+    $comment_permalink = url('comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid));
+    $time_ago = format_interval(REQUEST_TIME - $comment->timestamp);
+    $items[] = t('!username on <a href="@comment_permalink">@node_title</a> @time ago', array('!username' => $name, '@comment_permalink' => $comment_permalink, '@node_title' => $comment->node_title, '@time' => $time_ago));
   }
 
   if ($items) {
@@ -843,11 +879,6 @@ function comment_build_content($comment,
     $comment->content = array();
   }
 
-  // Build comment body.
-  $comment->content['comment_body'] = array(
-    '#markup' => check_markup($comment->comment, $comment->format, '', TRUE),
-  );
-
   field_attach_prepare_view('comment', array($comment->cid => $comment), $build_mode);
   $comment->content += field_attach_view('comment', $comment, $build_mode);
 
@@ -1003,11 +1034,6 @@ function comment_form_node_type_form_alt
       $form['comment']['comment_anonymous']['#access'] = FALSE;
     }
 
-    $form['comment']['comment_subject_field'] = array(
-      '#type' => 'checkbox',
-      '#title' => t('Allow comment title'),
-      '#default_value' => variable_get('comment_subject_field_' . $form['#node_type']->type, 1),
-    );
     $form['comment']['comment_form_location'] = array(
       '#type' => 'checkbox',
       '#title' => t('Show reply form on the same page as comments'),
@@ -1163,17 +1189,12 @@ function comment_node_delete($node) {
  * Implement hook_node_update_index().
  */
 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, '', TRUE);
-    }
-  }
-  return $text;
+  if ($node->comment && $cids = comment_get_thread($node)) {
+    $comments = comment_load_multiple($cids);
+    comment_prepare_thread($comments);
+    $build = comment_build_multiple($comments, $node);
+   }
+  return drupal_render($build);
 }
 
 /**
@@ -1291,9 +1312,6 @@ function comment_save($comment) {
         'status' => $comment->status,
         'created' => $comment->created,
         'changed' => $comment->changed,
-        'subject' => $comment->subject,
-        'comment' => $comment->comment,
-        'format' => $comment->comment_format,
         'uid' => $comment->uid,
         'name' => $comment->name,
         'mail' => $comment->mail,
@@ -1306,7 +1324,7 @@ function comment_save($comment) {
     // Allow modules to respond to the updating of a comment.
     module_invoke_all('comment_update', $comment);
     // Add an entry to the watchdog log.
-    watchdog('content', 'Comment: updated %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)));
+    watchdog('content', 'Comment: updated %cid.', array('%subject' => $comment->cid), WATCHDOG_NOTICE, l(t('view'), 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)));
   }
   else {
     // Add the comment to database. This next section builds the thread field.
@@ -1367,9 +1385,6 @@ function comment_save($comment) {
         'nid' => $comment->nid,
         'pid' => empty($comment->pid) ? 0 : $comment->pid,
         'uid' => $comment->uid,
-        'subject' => $comment->subject,
-        'comment' => $comment->comment,
-        'format' => $comment->comment_format,
         'hostname' => ip_address(),
         'created' => $comment->created,
         'changed' => $comment->changed,
@@ -1435,6 +1450,7 @@ function comment_delete_multiple($cids) 
       comment_delete_multiple($child_cids);
       _comment_update_node_statistics($comment->nid);
     }
+    parent::attachLoad($comments);
   }
 }
 
@@ -1829,15 +1845,6 @@ function comment_form($form, &$form_stat
     );
   }
 
-  if (variable_get('comment_subject_field_' . $node->type, 1) == 1) {
-    $form['subject'] = array(
-      '#type' => 'textfield',
-      '#title' => t('Subject'),
-      '#maxlength' => 64,
-      '#default_value' => !empty($comment->subject) ? $comment->subject : '',
-    );
-  }
-
   if (!empty($comment->comment)) {
     $default = $comment->comment;
   }
@@ -1845,15 +1852,6 @@ function comment_form($form, &$form_stat
     $default = '';
   }
 
-  $form['comment'] = array(
-    '#type' => 'textarea',
-    '#title' => t('Comment'),
-    '#rows' => 15,
-    '#default_value' => $default,
-    '#text_format' => isset($comment->format) ? $comment->format : filter_default_format(),
-    '#required' => TRUE,
-  );
-
   $form['cid'] = array(
     '#type' => 'value',
     '#value' => !empty($comment->cid) ? $comment->cid : NULL,
@@ -1928,7 +1926,6 @@ function comment_preview($comment) {
   $node = node_load($comment->nid);
 
   if (!form_get_errors()) {
-    $comment->format = $comment->comment_format;
 
     // Attach the user and time information.
     if (!empty($comment->author)) {
@@ -2052,19 +2049,6 @@ function comment_submit($comment) {
     $comment['name'] = $comment['author'];
   }
 
-  // Validate the comment's subject. If not specified, extract from comment body.
-  if (trim($comment['subject']) == '') {
-    // The body may be in any format, so:
-    // 1) Filter it into HTML
-    // 2) Strip out all HTML tags
-    // 3) Convert entities back to plain-text.
-    $comment['subject'] = truncate_utf8(trim(decode_entities(strip_tags(check_markup($comment['comment'], $comment['comment_format'])))), 29, TRUE);
-    // Edge cases where the comment body is populated only by HTML tags will
-    // require a default subject.
-    if ($comment['subject'] == '') {
-      $comment['subject'] = t('(No subject)');
-    }
-  }
   return (object)$comment;
 }
 
@@ -2113,8 +2097,8 @@ function comment_form_submit($form, &$fo
     $redirect = array('node/' . $node->nid, array('query' => $query, 'fragment' => 'comment-' . $comment->cid));
   }
   else {
-    watchdog('content', 'Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject), WATCHDOG_WARNING);
-    drupal_set_message(t('Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject)), 'error');
+    watchdog('content', 'Comment: unauthorized comment submitted or comment submitted to a closed post %title.', array('%title' => $node->title), WATCHDOG_WARNING);
+    drupal_set_message(t('Comment: unauthorized comment submitted or comment submitted to a closed post %title.', array('%title' => $node->title)), 'error');
     // Redirect the user to the node they are commenting on.
     $redirect = 'node/' . $node->nid;
   }
@@ -2139,7 +2123,7 @@ function template_preprocess_comment(&$v
   $variables['new']       = !empty($comment->new) ? t('new') : '';
   $variables['picture']   = theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', array('account' => $comment)) : '';
   $variables['signature'] = $comment->signature;
-  $variables['title']     = l($comment->subject, 'comment/' . $comment->cid, array('fragment' => "comment-$comment->cid"));
+  $variables['permalink'] = l('#', 'comment/' . $comment->cid, array('fragment' => "comment-$comment->cid"));
   $variables['template_files'][] = 'comment-' . $variables['node']->type;
 
   // Helpful $content variable for templates.
@@ -2364,7 +2348,6 @@ function comment_action_info() {
 function comment_publish_action($comment, $context = array()) {
   if (isset($comment->cid)) {
     $cid = $comment->cid;
-    $subject = $comment->subject;
   }
   else {
     $cid = $context['cid'];
@@ -2390,7 +2373,6 @@ function comment_publish_action($comment
 function comment_unpublish_action($comment, $context = array()) {
   if (isset($comment->cid)) {
     $cid = $comment->cid;
-    $subject = $comment->subject;
   }
   else {
     $cid = $context['cid'];
@@ -2400,7 +2382,7 @@ function comment_unpublish_action($comme
     ->fields(array('status' => COMMENT_NOT_PUBLISHED))
     ->condition('cid', $cid)
     ->execute();
-  watchdog('action', 'Unpublished comment %subject.', array('%subject' => $subject));
+  watchdog('action', 'Unpublished comment %cid.', array('%cid' => $cid));
 }
 
 /**
@@ -2419,12 +2401,13 @@ function comment_unpublish_action($comme
  */
 function comment_unpublish_by_keyword_action($comment, $context) {
   foreach ($context['keywords'] as $keyword) {
-    if (strpos($comment->comment, $keyword) !== FALSE || strpos($comment->subject, $keyword) !== FALSE) {
+    $text = drupal_render($comment);
+    if (strpos($text, $keyword) !== FALSE) {
       db_update('comment')
         ->fields(array('status' => COMMENT_NOT_PUBLISHED))
         ->condition('cid', $comment->cid)
         ->execute();
-      watchdog('action', 'Unpublished comment %subject.', array('%subject' => $comment->subject));
+      watchdog('action', 'Unpublished comment %cid.', array('%cid' => $comment->cid));
       break;
     }
   }
@@ -2484,13 +2467,3 @@ function comment_menu_alter(&$items) {
   // Add comments to the description for admin/content.
   $items['admin/content']['description'] = "View, edit, and delete your site's content and comments.";
 }
-
-/**
- * Implement hook_filter_format_delete().
- */
-function comment_filter_format_delete($format, $fallback) {
-  db_update('comment')
-    ->fields(array('format' => $fallback->format))
-    ->condition('format', $format->format)
-    ->execute();
-}

=== modified file 'modules/comment/comment.pages.inc'
--- modules/comment/comment.pages.inc	2009-10-16 21:00:03 +0000
+++ modules/comment/comment.pages.inc	2009-10-18 21:47:59 +0000
@@ -108,7 +108,6 @@ function comment_reply($node, $pid = NUL
  */
 function comment_approve($comment) {
   $comment->status = COMMENT_PUBLISHED;
-  $comment->comment_format = $comment->format;
   comment_save($comment);
 
   drupal_set_message(t('Comment approved.'));

=== modified file 'modules/comment/comment.test'
--- modules/comment/comment.test	2009-10-17 00:00:03 +0000
+++ modules/comment/comment.test	2009-10-18 21:48:18 +0000
@@ -23,8 +23,10 @@ class CommentHelperCase extends DrupalWe
    * @param mixed $contact Set to NULL for no contact info, TRUE to ignore success checking, and array of values to set contact info.
    */
   function postComment($node, $comment, $subject = '', $contact = NULL) {
+    $langcode = FIELD_LANGUAGE_NONE;
     $edit = array();
-    $edit['comment'] = $comment;
+    $edit["comment_subject[$langcode][0][value]"] = $subject;
+    $edit["comment_body[$langcode][0][value]"] = $comment;
 
     $preview_mode = variable_get('comment_preview_article', DRUPAL_OPTIONAL);
     $subject_mode = variable_get('comment_subject_field_article', 1);
@@ -116,16 +118,6 @@ class CommentHelperCase extends DrupalWe
   }
 
   /**
-   * Set comment subject setting.
-   *
-   * @param boolean $enabled
-   *   Subject value.
-   */
-  function setCommentSubject($enabled) {
-    $this->setCommentSettings('comment_subject_field', ($enabled ? '1' : '0'), 'Comment subject ' . ($enabled ? 'enabled' : 'disabled') . '.');
-  }
-
-  /**
    * Set comment preview setting.
    *
    * @param int $mode
@@ -226,21 +218,6 @@ class CommentHelperCase extends DrupalWe
       $this->assertText(t('The update has been performed.'), t('Operation "' . $operation . '" was performed on comment.'));
     }
   }
-
-  /**
-   * Get the comment ID for an unapproved comment.
-   *
-   * @param string $subject
-   *   Comment subject to find.
-   * @return integer
-   *   Comment id.
-   */
-  function getUnapprovedComment($subject) {
-    $this->drupalGet('admin/content/comment/approval');
-    preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->drupalGetContent(), $match);
-
-    return $match[2];
-  }
 }
 
 class CommentInterfaceTest extends CommentHelperCase {
@@ -256,11 +233,12 @@ class CommentInterfaceTest extends Comme
    * Test comment interface.
    */
   function testCommentInterface() {
+    $langcode = FIELD_LANGUAGE_NONE;
+
     // Set comments to have subject and preview disabled.
     $this->drupalLogin($this->admin_user);
     $this->setCommentPreview(DRUPAL_DISABLED);
     $this->setCommentForm(TRUE);
-    $this->setCommentSubject(FALSE);
     $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Comment paging changed.'));
     $this->drupalLogout();
 
@@ -294,7 +272,6 @@ class CommentInterfaceTest extends Comme
     // Set comments to have subject and preview to optional.
     $this->drupalLogout();
     $this->drupalLogin($this->admin_user);
-    $this->setCommentSubject(TRUE);
     $this->setCommentPreview(DRUPAL_OPTIONAL);
     $this->drupalLogout();
 
@@ -355,7 +332,7 @@ class CommentInterfaceTest extends Comme
     $this->assertTrue($this->node, t('Article node created.'));
     $this->drupalGet('comment/reply/' . $this->node->nid);
     $this->assertNoText('This discussion is closed', t('Posting to node with comments enabled'));
-    $this->assertField('edit-comment', t('Comment body field found.'));
+    $this->assertField("edit-comment-body-$langcode-0-value", t('Comment body field found.'));
 
     // Delete comment and make sure that reply is also removed.
     $this->drupalLogout();
@@ -401,61 +378,68 @@ class CommentPreviewTest extends Comment
    * Test comment preview.
    */
   function testCommentPreview() {
+    $langcode = FIELD_LANGUAGE_NONE;
+
     // As admin user, configure comment settings.
     $this->drupalLogin($this->admin_user);
     $this->setCommentPreview(TRUE);
     $this->setCommentForm(TRUE);
-    $this->setCommentSubject(TRUE);
     $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Comment paging changed.'));
     $this->drupalLogout();
 
     // As web user, fill in node creation form and preview node.
     $this->drupalLogin($this->web_user);
+    $subject = $this->randomName(8);
+    $body = $this->randomName(16);
     $edit = array();
-    $edit['subject'] = $this->randomName(8);
-    $edit['comment'] = $this->randomName(16);
+    $edit["comment_subject[$langcode][0][value]"] = $subject;
+    $edit["comment_body[$langcode][0][value]"] = $body;
     $this->drupalPost('node/' . $this->node->nid, $edit, t('Preview'));
 
     // Check that the preview is displaying the title and body.
     $this->assertTitle(t('Preview comment | Drupal'), t('Page title is "Preview comment".'));
-    $this->assertText($edit['subject'], t('Subject displayed.'));
-    $this->assertText($edit['comment'], t('Comment displayed.'));
+    $this->assertText($subject, t('Subject displayed.'));
+    $this->assertText($body, t('Comment displayed.'));
 
     // Check that the title and body fields are displayed with the correct values.
-    $this->assertFieldByName('subject', $edit['subject'], t('Subject field displayed.'));
-    $this->assertFieldByName('comment', $edit['comment'], t('Comment field displayed.'));
+    $this->assertFieldByName("comment_subject[$langcode][0][value]", $subject, t('Subject field displayed.'));
+    $this->assertFieldByName("comment_body[$langcode][0][value]", $body, t('Comment field displayed.'));
   }
 
   /**
    * Test comment edit and preview.
    */
   function testCommentEditPreview() {
+    $langcode = FIELD_LANGUAGE_NONE;
+
     $web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'post comments without approval'));
     $this->drupalLogin($this->admin_user);
     $this->setCommentPreview(TRUE);
     $this->setCommentForm(TRUE);
-    $this->setCommentSubject(TRUE);
     $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Comment paging changed.'));
 
+    $subject = $this->randomName(8);
+    $body = $this->randomName(16);
+
     $edit = array();
-    $edit['subject'] = $this->randomName(8);
-    $edit['comment'] = $this->randomName(16);
+    $edit["comment_subject[$langcode][0][value]"] = $subject;
+    $edit["comment_body[$langcode][0][value]"] = $body;
     $edit['author'] = $web_user->name;
     $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);
+    $comment = $this->postComment($this->node, $subject, $body, TRUE);
     $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".'));
-    $this->assertText($edit['subject'], t('Subject displayed.'));
-    $this->assertText($edit['comment'], t('Comment displayed.'));
+    $this->assertText($subject, t('Subject displayed.'));
+    $this->assertText($body, t('Comment displayed.'));
     $this->assertText($edit['author'], t('Author displayed.'));
     $this->assertText($expected_date, t('Date displayed.'));
 
     // Check that the title and body fields are displayed with the correct values.
-    $this->assertFieldByName('subject', $edit['subject'], t('Subject field displayed.'));
-    $this->assertFieldByName('comment', $edit['comment'], t('Comment field displayed.'));
+    $this->assertFieldByName("comment_subject[$langcode][0][value]", $subject, t('Subject field displayed.'));
+    $this->assertFieldByName("comment_body[$langcode][0][value]", $body, t('Comment field displayed.'));
     $this->assertFieldByName('author', $edit['author'], t('Author field displayed.'));
     $this->assertFieldByName('date', $edit['date'], t('Date field displayed.'));
   }
@@ -596,7 +580,6 @@ class CommentPagerTest extends CommentHe
 
     // Set comment variables.
     $this->setCommentForm(TRUE);
-    $this->setCommentSubject(TRUE);
     $this->setCommentPreview(FALSE);
 
     // Create a node and three comments.
@@ -693,7 +676,7 @@ class CommentApprovalTest extends Commen
 
     // Get unapproved comment id.
     $this->drupalLogin($this->admin_user);
-    $anonymous_comment4 = $this->getUnapprovedComment($subject);
+    $anonymous_comment4 = db_query('SELECT MAX(cid) FROM {comment} WHERE status = 0')->fetchField();
     $anonymous_comment4 = (object) array('id' => $anonymous_comment4, 'subject' => $subject, 'comment' => $body);
     $this->drupalLogout();
 
@@ -730,7 +713,7 @@ class CommentApprovalTest extends Commen
 
     // Get unapproved comment id.
     $this->drupalLogin($this->admin_user);
-    $anonymous_comment4 = $this->getUnapprovedComment($subject);
+    $anonymous_comment4 = db_query('SELECT MAX(cid) FROM {comment} WHERE status = 0')->fetchField();
     $anonymous_comment4 = (object) array('id' => $anonymous_comment4, 'subject' => $subject, 'comment' => $body);
     $this->drupalLogout();
 
@@ -795,10 +778,10 @@ class CommentBlockFunctionalTest extends
     $this->assertText($block['title'], t('Block was found.'));
 
     // Test the only the 2 latest comments are shown and in the proper order.
-    $this->assertNoText($comment1->subject, t('Comment not found in block.'));
-    $this->assertText($comment2->subject, t('Comment found in block.'));
-    $this->assertText($comment3->comment, t('Comment found in block.'));
-    $this->assertTrue(strpos($this->drupalGetContent(), $comment3->comment) < strpos($this->drupalGetContent(), $comment2->subject), t('Comments were ordered correctly in block.'));
+    $this->assertNoRaw("#comment-$comment1->id", t('Comment not found in block.'));
+    $this->assertRaw("#comment-$comment2->id", t('Comment found in block.'));
+    $this->assertRaw("#comment-$comment3->id", t('Comment found in block.'));
+    $this->assertTrue(strpos($this->drupalGetContent(), "#comment-$comment3->id") < strpos($this->drupalGetContent(), "#comment-$comment2->id"), t('Comments were ordered correctly in block.'));
 
     // Set the number of recent comments to show to 10.
     $this->drupalLogout();
@@ -820,13 +803,14 @@ class CommentBlockFunctionalTest extends
 
     // Test that links to comments work when comments are across pages.
     $this->setCommentsPerPage(1);
-    $this->drupalGet('');
-    $this->clickLink($comment1->subject);
+    $this->drupalGet('node/' . $this->node->nid);
+    $this->clickLink($this->node->title, 3);
     $this->assertText($comment1->subject, t('Comment link goes to correct page.'));
-    $this->drupalGet('');
-    $this->clickLink($comment2->subject);
+    $this->drupalGet('node/' . $this->node->nid);
+    $this->clickLink($this->node->title, 2);
     $this->assertText($comment2->subject, t('Comment link goes to correct page.'));
-    $this->clickLink($comment4->subject);
+    $this->drupalGet('node/' . $this->node->nid);
+    $this->clickLink($this->node->title, 0);
     $this->assertText($comment4->subject, t('Comment link goes to correct page.'));
     // Check that when viewing a comment page from a link to the comment, that
     // rel="canonical" is added to the head of the document.

=== modified file 'modules/comment/comment.tpl.php'
--- modules/comment/comment.tpl.php	2009-10-17 06:00:07 +0000
+++ modules/comment/comment.tpl.php	2009-10-18 21:47:59 +0000
@@ -14,11 +14,11 @@
  * - $created: Date and time this comment was created.
  * - $changed: Date and time this comment was changed.
  * - $new: New comment marker.
+ * - $permalink: Comment permalink.
  * - $picture: Authors picture.
  * - $signature: Authors signature.
  * - $status: Comment status. Possible values are:
  *   comment-unpublished, comment-published or comment-preview.
- * - $title: Linked title.
  * - $contextual_links (array): An array of contextual links for the comment.
  * - $classes: String of classes that can be used to style contextually through
  *   CSS. It can be manipulated through the variable $classes_array from
@@ -57,9 +57,8 @@
     <span class="new"><?php print $new ?></span>
   <?php endif; ?>
 
-  <h3<?php print $title_attributes; ?>><?php print $title ?></h3>
-
   <div class="submitted">
+    <?php print $permalink; ?>
     <?php
       print t('Submitted by !username on @datetime.',
         array('!username' => $author, '@datetime' => $created));

=== modified file 'modules/search/search.test'
--- modules/search/search.test	2009-10-17 00:00:03 +0000
+++ modules/search/search.test	2009-10-18 21:47:59 +0000
@@ -352,8 +352,10 @@ class SearchRankingTestCase extends Drup
     // Refresh variables after the treatment.
     $this->refreshVariables();
 
+    $langcode = FIELD_LANGUAGE_NONE;
+
     // Add a comment to one of the nodes.
-    $edit = array('subject' => 'my comment title', 'comment' => 'some random comment');
+    $edit = array("comment_subject[$langcode][0][value]" => 'my comment title', "comment_body[$langcode][0][value]" => 'some random comment');
     $this->drupalGet('comment/reply/' . $nodes['comments'][1]->nid);
     $this->drupalPost(NULL, $edit, t('Preview'));
     $this->drupalPost(NULL, $edit, t('Save'));
@@ -490,10 +492,11 @@ class SearchCommentTestCase extends Drup
     // Create a node.
     $node = $this->drupalCreateNode(array('type' => 'article'));
     // Post a comment using 'Full HTML' text format.
+    $langcode = FIELD_LANGUAGE_NONE;
     $edit_comment = array(
-      'subject' => $this->randomName(2),
-      'comment' => '<h1>' . $comment_body . '</h1>',
-      'comment_format' => 2,
+      "comment_subject[$langcode][0][value]" => $this->randomName(2),
+      "comment_body[$langcode][0][value]" => '<h1>' . $comment_body . '</h1>',
+      "comment_body[$langcode][0][value_format]" => 2,
     );
     $this->drupalPost('comment/reply/' . $node->nid, $edit_comment, t('Save'));
 
@@ -509,10 +512,9 @@ class SearchCommentTestCase extends Drup
     $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node found in search results.'));
 
     // Verify that comment is rendered using proper format.
-    $this->assertText($edit_comment['subject'], t('Comment subject found in search results.'));
     $this->assertText($comment_body, t('Comment body text found in search results.'));
     $this->assertNoRaw(t('n/a'), t('HTML in comment body is not hidden.'));
-    $this->assertNoRaw(check_plain($edit_comment['comment']), t('HTML in comment body is not escaped.'));
+    $this->assertNoRaw(check_plain($edit_comment["comment_body[$langcode][0][value]"]), t('HTML in comment body is not escaped.'));
 
     // Hide comments.
     $this->drupalLogin($this->admin_user);

=== modified file 'modules/tracker/tracker.test'
--- modules/tracker/tracker.test	2009-10-11 04:00:03 +0000
+++ modules/tracker/tracker.test	2009-10-18 21:47:59 +0000
@@ -50,6 +50,8 @@ class TrackerTest extends DrupalWebTestC
    * Test the presence of nodes on a user's tracker listing.
    */
   function testTrackerUser() {
+    $langcode = FIELD_LANGUAGE_NONE;
+
     $this->drupalLogin($this->user);
 
     $unpublished = $this->drupalCreateNode(array(
@@ -73,8 +75,8 @@ class TrackerTest extends DrupalWebTestC
       'status' => 1,
     ));
     $comment = array(
-      'subject' => $this->randomName(),
-      'comment' => $this->randomName(20),
+      "comment_subject[$langcode][0][value]" => $this->randomName(),
+      "comment_body[$langcode][0][value]" => $this->randomName(20),
     );
     $this->drupalPost('comment/reply/' . $other_published_my_comment->nid, $comment, t('Save'));
 
@@ -117,6 +119,8 @@ class TrackerTest extends DrupalWebTestC
    * Test comment counters on the tracker listing.
    */
   function testTrackerNewComments() {
+    $langcode = FIELD_LANGUAGE_NONE;
+
     $this->drupalLogin($this->user);
 
     $node = $this->drupalCreateNode(array(
@@ -126,8 +130,8 @@ class TrackerTest extends DrupalWebTestC
 
     // Add a comment to the page.
     $comment = array(
-      'subject' => $this->randomName(),
-      'comment' => $this->randomName(20),
+      "comment_subject[$langcode][0][value]" => $this->randomName(),
+      "comment_body[$langcode][0][value]" => $this->randomName(20),
     );
     $this->drupalPost('comment/reply/' . $node->nid, $comment, t('Save')); // The new comment is automatically viewed by the current user.
 
@@ -138,8 +142,8 @@ class TrackerTest extends DrupalWebTestC
 
     // Add another comment as other_user.
     $comment = array(
-      'subject' => $this->randomName(),
-      'comment' => $this->randomName(20),
+      "comment_subject[$langcode][0][value]" => $this->randomName(),
+      "comment_body[$langcode][0][value]" => $this->randomName(20),
     );
     // If the comment is posted in the same second as the last one then Drupal
     // can't tell a difference, so wait one second here.
@@ -155,6 +159,8 @@ class TrackerTest extends DrupalWebTestC
    * Test that existing nodes are indexed by cron.
    */
   function testTrackerCronIndexing() {
+    $langcode = FIELD_LANGUAGE_NONE;
+
     $this->drupalLogin($this->user);
 
     // Create 3 nodes.
@@ -171,8 +177,8 @@ class TrackerTest extends DrupalWebTestC
     // Add a comment to the last node as other user.
     $this->drupalLogin($this->other_user);
     $comment = array(
-      'subject' => $this->randomName(),
-      'comment' => $this->randomName(20),
+      "comment_subject[$langcode][0][value]" => $this->randomName(),
+      "comment_body[$langcode][0][value]" => $this->randomName(20),
     );
     $this->drupalPost('comment/reply/' . $nodes[3]->nid, $comment, t('Save'));
 

=== modified file 'themes/garland/comment.tpl.php'
--- themes/garland/comment.tpl.php	2009-10-17 06:00:07 +0000
+++ themes/garland/comment.tpl.php	2009-10-18 21:57:20 +0000
@@ -4,20 +4,18 @@
 <div class="<?php print $classes . ' ' . $zebra; ?>"<?php print $attributes; ?>>
 
   <div class="clearfix">
+    <span class="submitted"><?php print $permalink; ?> <?php print $created; ?> — <?php print $author; ?></span>
 
   <?php if ($contextual_links): ?>
     <?php print render($contextual_links); ?>
   <?php endif; ?>
 
-    <span class="submitted"><?php print $created; ?> — <?php print $author; ?></span>
+    <?php if ($new) : ?>
+      <span class="new"><?php print drupal_ucfirst($new) ?></span>
+    <?php endif; ?>
 
-  <?php if ($new) : ?>
-    <span class="new"><?php print drupal_ucfirst($new) ?></span>
-  <?php endif; ?>
-
-  <?php print $picture ?>
+    <?php print $picture ?>
 
-    <h3<?php print $title_attributes; ?>><?php print $title ?></h3>
 
     <div class="content">
       <?php hide($content['links']); print render($content); ?>

