Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1167
diff -u -p -r1.1167 node.module
--- modules/node/node.module	14 Nov 2009 07:58:49 -0000	1.1167
+++ modules/node/node.module	14 Nov 2009 16:31:35 -0000
@@ -667,12 +667,14 @@ function _node_types_build() {
   }
   $_node_types = (object)array('types' => array(), 'names' => array());
 
+  // Add node types registered by hook_node_info() implementations.
   $info_array = module_invoke_all('node_info');
   foreach ($info_array as $type => $info) {
     $info['type'] = $type;
     $_node_types->types[$type] = node_type_set_defaults($info);
     $_node_types->names[$type] = $info['name'];
   }
+  // Retrieve stored node types from the database.
   $type_result = db_select('node_type', 'nt')
     ->addTag('translatable')
     ->addTag('node_type_access')
@@ -687,10 +689,14 @@ function _node_types_build() {
     if (isset($type_object->base) && $type_object->base != 'node_content' && empty($info_array[$type_object->type])) {
       $type_object->disabled = TRUE;
     }
+    // Add manually created node types (not registered via hook_node_info()) to
+    // the list of node types, and also overwrite the registered node type info
+    // in case a module-provided node type has been modified.
     if (!isset($_node_types->types[$type_object->type]) || $type_object->modified) {
       $_node_types->types[$type_object->type] = $type_object;
       $_node_types->names[$type_object->type] = $type_object->name;
-
+      // Prevent a renamed node type from being used in case the renaming
+      // process was not completed yet.
       if ($type_object->type != $type_object->orig_type) {
         unset($_node_types->types[$type_object->orig_type]);
         unset($_node_types->names[$type_object->orig_type]);
