? DELETE
? MISC-FIELD-CHANGES-REAPPLY.patch
? Makefile
? article.macro
? d6local.sql_.gz
? head.kpf
? patches
? test.php
? upgraded.sql.gz
? modules/field/field.bulk.update.inc
? scripts/OLD-generate-autoload.pl
? scripts/generate-autoload.pl
? sites/all/cck
? sites/all/modules/admin_menu
? sites/all/modules/color
? sites/all/modules/combofield
? sites/all/modules/devel
? sites/all/modules/macro
? sites/all/modules/pbs
? sites/all/modules/pipedream
? sites/all/modules/taint
? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: modules/comment/comment.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.install,v
retrieving revision 1.69
diff -u -F '^[fc]' -r1.69 comment.install
--- modules/comment/comment.install	22 Aug 2010 14:55:29 -0000	1.69
+++ modules/comment/comment.install	24 Aug 2010 08:45:44 -0000
@@ -7,6 +7,35 @@
  */
 
 /**
+ * Implements hook_install().
+ */
+function comment_install() {
+  // Create comment body field.
+  if (!field_info_field('comment_body')) {
+    $field = array(
+      'field_name' => 'comment_body',
+      'type' => 'text_long',
+      'entity_types' => array('comment'),
+    );
+    field_create_field($field);
+  }
+
+  // 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
+  // node types whose comments are disabled by default, because individual nodes
+  // may override that default.
+  // @todo This should be changed to call field_attach_create_bundle() instead,
+  //   and a comment_field_attach_create_bundle() function should be added to
+  //   handle the creation of the comment body field instance.
+  foreach (node_type_get_types() as $type => $info) {
+    if (!isset($info->is_new) && !isset($info->disabled) && !field_info_instance('comment', 'comment_body', 'comment_node_' . $info->type)) {
+      _comment_body_field_instance_create($info);
+    }
+  }
+}
+
+/**
  * Implements hook_uninstall().
  */
 function comment_uninstall() {
@@ -46,33 +75,6 @@ function comment_enable() {
   db_insert('node_comment_statistics')
     ->from($query)
     ->execute();
-
-  // Create comment body field.
-  // @todo this should be done in comment_install, but causes exceptions
-  // in testing because the list of fields types is not available in
-  // hook_install(): _field_info_collate_types() returns an empty array.
-  if (!field_info_field('comment_body')) {
-    $field = array(
-      'field_name' => 'comment_body',
-      'type' => 'text_long',
-      'entity_types' => array('comment'),
-    );
-    field_create_field($field);
-  }
-
-  // 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
-  // node types whose comments are disabled by default, because individual nodes
-  // may override that default.
-  // @todo This should be changed to call field_attach_create_bundle() instead,
-  //   and a comment_field_attach_create_bundle() function should be added to
-  //   handle the creation of the comment body field instance.
-  foreach (node_type_get_types() as $type => $info) {
-    if (!isset($info->is_new) && !isset($info->disabled) && !field_info_instance('comment', 'comment_body', 'comment_node_' . $info->type)) {
-      _comment_body_field_instance_create($info);
-    }
-  }
 }
 
 /**
