diff --git a/core/modules/comment/comment.admin.inc b/core/modules/comment/comment.admin.inc index 4a3220f..ef8a90b 100644 --- a/core/modules/comment/comment.admin.inc +++ b/core/modules/comment/comment.admin.inc @@ -110,13 +110,14 @@ function comment_admin_overview($form, &$form_state, $arg) { // Remove the first node title from the node_titles array and attach to // the comment. $comment->node_title = array_shift($node_titles); + $comment_body = field_get_items('comment', $comment, 'comment_body'); $options[$comment->cid] = array( 'subject' => array( 'data' => array( '#type' => 'link', '#title' => $comment->subject, '#href' => 'comment/' . $comment->cid, - '#options' => array('attributes' => array('title' => truncate_utf8($comment->comment_body[LANGUAGE_NOT_SPECIFIED][0]['value'], 128)), 'fragment' => 'comment-' . $comment->cid), + '#options' => array('attributes' => array('title' => truncate_utf8($comment_body[0]['value'], 128)), 'fragment' => 'comment-' . $comment->cid), ), ), 'author' => theme('username', array('account' => $comment)), diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 44b4c04..27ff7c3 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1690,7 +1690,8 @@ function comment_preview(Comment $comment) { $node = node_load($comment->nid); if (!form_get_errors()) { - $comment->format = $comment->comment_body[LANGUAGE_NOT_SPECIFIED][0]['format']; + $comment_body = field_get_items('comment', $comment, 'comment_body'); + $comment->format = $comment_body[0]['format']; // Attach the user and time information. if (!empty($comment->name)) { $account = user_load_by_name($comment->name); diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index 7dae92d..b4d4958 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -174,7 +174,8 @@ class CommentFormController extends EntityFormController { } $form['node_type'] = array('#type' => 'value', '#value' => 'comment_node_' . $node->type); - // Make the comment inherit the node language unless specifically set. + // Make the comment inherit the current content language unless specifically + // set. $comment_langcode = $comment->langcode; if ($comment_langcode == LANGUAGE_NOT_SPECIFIED) { $comment_langcode = $language_content->langcode; @@ -294,7 +295,9 @@ class CommentFormController extends EntityFormController { // 1) Filter it into HTML // 2) Strip out all HTML tags // 3) Convert entities back to plain-text. - $comment_body = $comment->comment_body[LANGUAGE_NOT_SPECIFIED][0]; + $field = field_info_field('comment_body'); + $langcode = field_is_translatable('comment', $field) ? $this->getFormLangcode($form_state) : LANGUAGE_NOT_SPECIFIED; + $comment_body = $comment->comment_body[$langcode][0]; if (isset($comment_body['format'])) { $comment_text = check_markup($comment_body['value'], $comment_body['format']); }