 .../src/Plugin/migrate/source/d7/Comment.php       |  7 +++
 .../Plugin/migrate/source/d7/CommentTest.php       | 72 ++++++++++++++++++++++
 2 files changed, 79 insertions(+)

diff --git a/core/modules/comment/src/Plugin/migrate/source/d7/Comment.php b/core/modules/comment/src/Plugin/migrate/source/d7/Comment.php
index 73c2d8f4f7..f7b17aa5eb 100644
--- a/core/modules/comment/src/Plugin/migrate/source/d7/Comment.php
+++ b/core/modules/comment/src/Plugin/migrate/source/d7/Comment.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\comment\Plugin\migrate\source\d7;
 
+use Drupal\Core\Language\LanguageInterface;
 use Drupal\migrate\Row;
 use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;
 
@@ -44,6 +45,12 @@ public function prepareRow(Row $row) {
     $source_language = $this->getEntityTranslationSourceLanguage('comment', $cid);
     $language = $entity_translatable && $source_language ? $source_language : $row->getSourceProperty('language');
 
+    // If this comment was upgraded from Drupal 6 or older, it's possible that
+    // no language code was specified.
+    if ($row->getSourceProperty('language') === '') {
+      $row->setSourceProperty('language', LanguageInterface::LANGCODE_NOT_SPECIFIED);
+    }
+
     // Get Field API field values.
     foreach ($this->getFields('comment', $comment_type) as $field_name => $field) {
       // Ensure we're using the right language if the entity and the field are
diff --git a/core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d7/CommentTest.php b/core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d7/CommentTest.php
index dc99489563..1231a7a377 100644
--- a/core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d7/CommentTest.php
+++ b/core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d7/CommentTest.php
@@ -42,6 +42,24 @@ public function providerSource() {
         'language' => 'und',
       ],
     ];
+    $tests[1]['source_data']['comment'] = [
+      [
+        'cid' => '2',
+        'pid' => '0',
+        'nid' => '1',
+        'uid' => '1',
+        'subject' => 'A comment migrated from Drupal 6',
+        'hostname' => '::1',
+        'created' => '1421727535',
+        'changed' => '1421727535',
+        'status' => '1',
+        'thread' => '02/',
+        'name' => 'admin',
+        'mail' => '',
+        'homepage' => '',
+        'language' => '',
+      ],
+    ];
     $tests[0]['source_data']['node'] = [
       [
         'nid' => '1',
@@ -60,6 +78,7 @@ public function providerSource() {
         'translate' => '0',
       ],
     ];
+    $tests[1]['source_data']['node'] = $tests[0]['source_data']['node'];
     $tests[0]['source_data']['field_config'] = [
       [
         'id' => '1',
@@ -70,6 +89,7 @@ public function providerSource() {
         'translatable' => '1',
       ],
     ];
+    $tests[1]['source_data']['field_config'] = $tests[0]['source_data']['field_config'];
     $tests[0]['source_data']['field_config_instance'] = [
       [
         'id' => '14',
@@ -90,6 +110,7 @@ public function providerSource() {
         'deleted' => '0',
       ],
     ];
+    $tests[1]['source_data']['field_config_instance'] = $tests[0]['source_data']['field_config_instance'];
     $tests[0]['source_data']['field_data_comment_body'] = [
       [
         'entity_type' => 'comment',
@@ -103,6 +124,19 @@ public function providerSource() {
         'comment_body_format' => 'filtered_html',
       ],
     ];
+    $tests[1]['source_data']['field_data_comment_body'] = [
+      [
+        'entity_type' => 'comment',
+        'bundle' => 'comment_node_test_content_type',
+        'deleted' => '0',
+        'entity_id' => '2',
+        'revision_id' => '2',
+        'language' => 'und',
+        'delta' => '0',
+        'comment_body_value' => 'This is a comment migrated from Drupal 6',
+        'comment_body_format' => 'filtered_html',
+      ],
+    ];
     $tests[0]['source_data']['field_data_subject_field'] = [
       [
         'entity_type' => 'comment',
@@ -116,6 +150,19 @@ public function providerSource() {
         'subject_field_format' => NULL,
       ],
     ];
+    $tests[1]['source_data']['field_data_subject_field'] = [
+      [
+        'entity_type' => 'comment',
+        'bundle' => 'comment_node_test_content_type',
+        'deleted' => '0',
+        'entity_id' => '1',
+        'revision_id' => '1',
+        'language' => 'und',
+        'delta' => '0',
+        'subject_field_value' => 'A comment migrated from Drupal 6 (subject_field)',
+        'subject_field_format' => NULL,
+      ],
+    ];
     $tests[0]['source_data']['system'] = [
       [
         'name' => 'title',
@@ -123,6 +170,7 @@ public function providerSource() {
         'status' => 1,
       ],
     ];
+    $tests[1]['source_data']['system'] = $tests[0]['source_data']['system'];
 
     // The expected results.
     $tests[0]['expected_data'] = [
@@ -149,6 +197,30 @@ public function providerSource() {
         ],
       ],
     ];
+    $tests[1]['expected_data'] = [
+      [
+        'cid' => '2',
+        'pid' => '0',
+        'nid' => '1',
+        'uid' => '1',
+        'subject' => 'A comment migrated from Drupal 6',
+        'hostname' => '::1',
+        'created' => '1421727535',
+        'changed' => '1421727535',
+        'status' => '1',
+        'thread' => '02/',
+        'name' => 'admin',
+        'mail' => '',
+        'homepage' => '',
+        'language' => 'und',
+        'comment_body' => [
+          [
+            'value' => 'This is a comment migrated from Drupal 6',
+            'format' => 'filtered_html',
+          ],
+        ],
+      ],
+    ];
 
     return $tests;
   }
