summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-12-13 10:24:58 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-12-13 10:24:58 +0000
commita043194e3fd94ca861adf479b9e02cd41d2cb144 (patch)
treebec62f11a2ab987e6f4b22cfa3110b8cbaa3ecfe
parent3f829e1ff5e7a578c3c1492151c873d014195f32 (diff)
downloadbrdo-a043194e3fd94ca861adf479b9e02cd41d2cb144.tar.gz
brdo-a043194e3fd94ca861adf479b9e02cd41d2cb144.tar.bz2
#102353: Fix comment tracking when comment module has been disabled.
-rw-r--r--modules/comment/comment.install10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
new file mode 100644
index 000000000..eda099ebe
--- /dev/null
+++ b/modules/comment/comment.install
@@ -0,0 +1,10 @@
+<?php
+// $Id$
+
+/**
+ * Implementation of hook_enable().
+ */
+function comment_enable() {
+ // Insert records into the node_comment_statistics for nodes that are missing.
+ db_query("INSERT INTO {node_comment_statistics} (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) SELECT n.nid, n.created, NULL, n.uid, 0 FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE c.comment_count IS NULL");
+}