Index: modules/comment/comment.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.install,v
retrieving revision 1.60
diff -u -r1.60 comment.install
--- modules/comment/comment.install	3 Feb 2010 18:16:23 -0000	1.60
+++ modules/comment/comment.install	15 Feb 2010 19:45:05 -0000
@@ -60,6 +60,12 @@
     field_create_field($field);
   }
 
+  // This is running during module enable. We must ensure that the node
+  // types list is up-to-date in the database, or else we may be attaching
+  // comment fields to types that don't really exist yet or that are about
+  // to be removed.
+  node_types_rebuild();
+
   // There is a separate comment bundle for each node type to allow for
   // per-node-type customization of comment fields. Each one of these bundles
   // needs a comment body field instance. A comment bundle is needed even for
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1232
diff -u -r1.1232 node.module
--- modules/node/node.module	15 Feb 2010 19:00:30 -0000	1.1232
+++ modules/node/node.module	15 Feb 2010 19:45:05 -0000
@@ -389,6 +389,10 @@
 /**
  * Returns a list of all the available node types.
  *
+ * If you are calling this function during hook_enable() or hook_install()
+ * implementations for a module, call node_types_rebuild() first to ensure
+ * that the node types have all been created properly.
+ *
  * @return
  *   An array of node types, keyed by the type.
  * @see node_type_get_type()
