diff --git a/modules/node/node.install b/modules/node/node.install
index 4be27cb..a94cbbc 100644
--- a/modules/node/node.install
+++ b/modules/node/node.install
@@ -442,7 +442,21 @@ function node_update_dependencies() {
  * @ingroup update-api-6.x-to-7.x
  */
 function _update_7000_node_get_types() {
-  return db_query('SELECT * FROM {node_type}')->fetchAllAssoc('type', PDO::FETCH_OBJ);
+  $node_types = db_query('SELECT * FROM {node_type}')->fetchAllAssoc('type', PDO::FETCH_OBJ);
+
+  // Create default settings for orphan nodes.
+  $extra_types = db_query('SELECT DISTINCT type FROM {node} WHERE type NOT IN (:types)', array(':types' => array_keys($node_types)))->fetchCol();
+  foreach ($extra_types as $type) {
+    $type_object = new stdClass;
+    $type_object->type = $type;
+    // Always create a body. Querying node_revisions for a non-empty body
+    // would skip creating body fields for types that have a body but
+    // the nodes of that type so far had empty bodies.
+    $type_object->has_body = 1;
+    $type_object->body_label = 'Body';
+    $node_types[$type_object->type] = $type_object;
+  }
+  return $node_types;
 }
 
 /**
@@ -573,19 +587,6 @@ function node_update_7006(&$sandbox) {
     // Get node type info, specifically the body field settings.
     $node_types = _update_7000_node_get_types();
 
-    // Create default settings for orphan nodes.
-    $extra_types = db_query('SELECT DISTINCT type FROM {node} WHERE type NOT IN (:types)', array(':types' => array_keys($node_types)))->fetchCol();
-    foreach ($extra_types as $type) {
-      $type_object = new stdClass;
-      $type_object->type = $type;
-      // Always create a body. Querying node_revisions for a non-empty body
-      // would skip creating body fields for types that have a body but
-      // the nodes of that type so far had empty bodies.
-      $type_object->has_body = 1;
-      $type_object->body_label = 'Body';
-      $node_types[$type_object->type] = $type_object;
-    }
-
     // Add body field instances for existing node types.
     foreach ($node_types as $node_type) {
       if ($node_type->has_body) {
diff --git a/modules/simpletest/tests/upgrade/drupal-6.node_type_broken.database.php b/modules/simpletest/tests/upgrade/drupal-6.node_type_broken.database.php
new file mode 100644
index 0000000..1dc1946
--- /dev/null
+++ b/modules/simpletest/tests/upgrade/drupal-6.node_type_broken.database.php
@@ -0,0 +1,34 @@
+<?php
+db_insert('comments')->fields(array(
+  'cid',
+  'pid',
+  'nid',
+  'uid',
+  'subject',
+  'comment',
+  'hostname',
+  'timestamp',
+  'status',
+  'format',
+  'thread',
+  'name',
+  'mail',
+  'homepage',
+))
+->values(array(
+  'cid' => 1,
+  'pid' => 0,
+  'nid' => 37,
+  'uid' => 3,
+  'subject' => 'Comment title 1',
+  'comment' => 'Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1',
+  'hostname' => '127.0.0.1',
+  'timestamp' => 1008617630,
+  'status' => 0,
+  'format' => 1,
+  'thread' => '01/',
+  'name' => NULL,
+  'mail' => NULL,
+  'homepage' => '',
+))
+->execute();
diff --git a/modules/simpletest/tests/upgrade/upgrade.node.test b/modules/simpletest/tests/upgrade/upgrade.node.test
index d2366b7..7873ac1 100644
--- a/modules/simpletest/tests/upgrade/upgrade.node.test
+++ b/modules/simpletest/tests/upgrade/upgrade.node.test
@@ -47,6 +47,38 @@ class NodeBodyUpgradePathTestCase extends UpgradePathTestCase {
 }
 
 /**
+ * Upgrade test for node disabled node types.
+ *
+ * Load a filled installation of Drupal 6 and run the upgrade process on it.
+ */
+class DisabledNodeTypeTestCase extends UpgradePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name'  => 'Disabled node type upgrade path',
+      'description'  => 'Disabled node type upgrade path tests.',
+      'group' => 'Upgrade path',
+    );
+  }
+
+  public function setUp() {
+    // Path to the database dump.
+    $this->databaseDumpFiles = array(
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.filled.database.php',
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.node_type_broken.database.php',
+    );
+    parent::setUp();
+  }
+
+  /**
+   * Test a successful upgrade.
+   */
+  public function testDisabledNodeTypeUpgrade() {
+    $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+    $this->assertTrue(field_info_instance('comment', 'comment_body', 'comment_node_broken'), 'Comment body field instance was created for comments attached to the disabled broken node type');
+  }
+}
+
+/**
  * Upgrade test for node type poll.
  *
  * Load a bare installation of Drupal 6 and run the upgrade process on it.
