diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-03-24 10:18:40 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-03-24 10:18:40 +0000 |
commit | 92bd43b3ecfee9af69214c2a3751600a8dcb659e (patch) | |
tree | ef5390f4e5967c3969ccb0e6bd8c0bbe49748237 /modules/comment | |
parent | 739cc9851f51c31af3c29d317ea733b0ada54907 (diff) | |
download | brdo-92bd43b3ecfee9af69214c2a3751600a8dcb659e.tar.gz brdo-92bd43b3ecfee9af69214c2a3751600a8dcb659e.tar.bz2 |
- Patch #737858 by moshe weitzman: move watchdog to form submit - our of comment_save().
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/comment.module | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 6fdb9867e..ee586e8e3 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1399,8 +1399,6 @@ function comment_save($comment) { // Allow modules to respond to the updating of a comment. module_invoke_all('comment_update', $comment); entity_invoke('update', 'comment', $comment); - // Add an entry to the watchdog log. - watchdog('content', 'Comment: updated %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid))); } else { // Add the comment to database. This next section builds the thread field. @@ -1483,8 +1481,6 @@ function comment_save($comment) { // Tell the other modules a new comment has been submitted. module_invoke_all('comment_insert', $comment); entity_invoke('insert', 'comment', $comment); - // Add an entry to the watchdog log. - watchdog('content', 'Comment: added %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid))); } _comment_update_node_statistics($comment->nid); // Clear the cache so an anonymous user can see his comment being added. @@ -2090,6 +2086,10 @@ function comment_form_submit($form, &$form_state) { comment_save($comment); $form_state['values']['cid'] = $comment->cid; + + // Add an entry to the watchdog log. + watchdog('content', 'Comment posted: %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid))); + // Explain the approval queue if necessary. if ($comment->status == COMMENT_NOT_PUBLISHED) { if (!user_access('administer comments')) { |