diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-06 05:53:30 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-06 05:53:30 +0000 |
commit | f2e3917acbd0b2ed215db7f5f0817d5dab19e692 (patch) | |
tree | b98294cf3d38cb8c9f65e8c646d2b70592e39185 /modules/comment | |
parent | 1bb6e13d7893704d5cf73ef3d8447bf9695a83be (diff) | |
download | brdo-f2e3917acbd0b2ed215db7f5f0817d5dab19e692.tar.gz brdo-f2e3917acbd0b2ed215db7f5f0817d5dab19e692.tar.bz2 |
- Patch #762234 by catch: give modules access to updated comment statistics in hook_comment_insert() and hook_comment_update().
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/comment.module | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 45cccdf8e..42f9a0ff2 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1410,6 +1410,10 @@ function comment_save($comment) { )) ->condition('cid', $comment->cid) ->execute(); + + // Update the {node_comment_statistics} table prior to executing hooks. + _comment_update_node_statistics($comment->nid); + field_attach_update('comment', $comment); // Allow modules to respond to the updating of a comment. module_invoke_all('comment_update', $comment); @@ -1495,14 +1499,15 @@ function comment_save($comment) { // saved node to be propagated to the slave. db_ignore_slave(); + // Update the {node_comment_statistics} table prior to executing hooks. + _comment_update_node_statistics($comment->nid); + field_attach_insert('comment', $comment); // Tell the other modules a new comment has been submitted. module_invoke_all('comment_insert', $comment); entity_invoke('insert', 'comment', $comment); } - _comment_update_node_statistics($comment->nid); - if ($comment->status == COMMENT_PUBLISHED) { module_invoke_all('comment_publish', $comment); } |