diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-08-31 21:58:36 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-08-31 21:58:36 +0000 |
commit | 49fa25fb7658ada5ee242853d3ed301d0a0b05a9 (patch) | |
tree | 12fb57e50398413cc420df5ed486b77b9c996aa2 /modules/comment/comment.module | |
parent | c64db1da29a6b2067f09e66e5e85e8877b489cb0 (diff) | |
download | brdo-49fa25fb7658ada5ee242853d3ed301d0a0b05a9.tar.gz brdo-49fa25fb7658ada5ee242853d3ed301d0a0b05a9.tar.bz2 |
- Rollback of patch #68418: clean up node submit hooks. Needs more thinkering.
Restores the old node API.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 0df7c1f13..b47ace8f8 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -278,7 +278,6 @@ function comment_form_alter($form_id, &$form) { } elseif (isset($form['type'])) { if ($form['type']['#value'] .'_node_form' == $form_id) { - $form['#submit']['comment_node_submit'] = array(); $node = $form['#node']; $form['comment_settings'] = array( '#type' => 'fieldset', @@ -296,10 +295,6 @@ function comment_form_alter($form_id, &$form) { ); } } - - if ($form_id == 'node_delete_confirm') { - $form['#submit']['comment_node_delete_confirm_submit'] = array(); - } } /** @@ -318,6 +313,15 @@ function comment_nodeapi(&$node, $op, $arg = 0) { } break; + case 'insert': + db_query('INSERT INTO {node_comment_statistics} (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) VALUES (%d, %d, NULL, %d, 0)', $node->nid, $node->created, $node->uid); + break; + + case 'delete': + db_query('DELETE FROM {comments} WHERE nid = %d', $node->nid); + db_query('DELETE FROM {node_comment_statistics} WHERE nid = %d', $node->nid); + break; + case 'update index': $text = ''; $comments = db_query('SELECT subject, comment, format FROM {comments} WHERE nid = %d AND status = %d', $node->nid, COMMENT_PUBLISHED); @@ -340,17 +344,6 @@ function comment_nodeapi(&$node, $op, $arg = 0) { } } -function comment_node_delete_confirm_submit($form_id, $form_values) { - db_query('DELETE FROM {comments} WHERE nid = %d', $form_values['node']->nid); - db_query('DELETE FROM {node_comment_statistics} WHERE nid = %d', $form_values['node']->nid); -} - -function comment_node_submit($form_id, $node) { - if ($node->is_new) { - db_query('INSERT INTO {node_comment_statistics} (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) VALUES (%d, %d, NULL, %d, 0)', $node->nid, $node->created, $node->uid); - } -} - /** * Implementation of hook_user(). * |