Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1330
diff -u -p -r1.1330 node.module
--- modules/node/node.module	2 Dec 2010 23:58:21 -0000	1.1330
+++ modules/node/node.module	10 Dec 2010 02:29:32 -0000
@@ -728,14 +728,20 @@ function _node_types_build($rebuild = FA
     }
     $_node_types->types[$type_db]->disabled = $type_object->disabled;
     $_node_types->types[$type_db]->disabled_changed = $disabled != $type_object->disabled;
+    // This type is not new.
+    unset($_node_types->types[$type_db]->is_new);
   }
 
   if ($rebuild) {
     foreach ($_node_types->types as $type => $type_object) {
       if (!empty($type_object->is_new) || !empty($type_object->disabled_changed)) {
         node_type_save($type_object);
+        // Since the type has been saved, the is_new flag is no longer needed.
+        unset($_node_types->types[$type]->is_new);
       }
     }
+    // Invalidate the static cache.
+    drupal_static_reset(__FUNCTION__);
   }
 
   asort($_node_types->names);
Index: modules/node/node.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.test,v
retrieving revision 1.104
diff -u -p -r1.104 node.test
--- modules/node/node.test	9 Dec 2010 08:01:56 -0000	1.104
+++ modules/node/node.test	10 Dec 2010 02:29:33 -0000
@@ -1220,6 +1220,21 @@ class NodeTypeTestCase extends DrupalWeb
     $this->drupalGet('node/add/bar');
     $this->assertNoRaw('Body', t('Body field was not found.'));
   }
+
+  /**
+   * Test that fresh node types are returned by node_type_get_types().
+   */
+  function testNodeTypeCaching() {
+    // Prime the node type cache.
+    node_types_rebuild();
+    // Enable the blog module, which provides a content type.
+    module_enable(array('blog'), FALSE);
+    $this->resetAll();
+    // node_type_get_types() should include the new type.
+    $new_types = node_type_get_types();
+    $this->assertTrue(isset($new_types['blog']), t('Retrieved node types include new type.'));
+    $this->assertTrue(empty($new_types['blog']->is_new), t('The is_new flag was unset after the type was saved.'));
+  }
 }
 
 /**
