Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
92bd43b3
Commit
92bd43b3
authored
Mar 24, 2010
by
Dries Buytaert
Browse files
- Patch
#737858
by moshe weitzman: move watchdog to form submit - our of comment_save().
parent
739cc985
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/comment/comment.module
View file @
92bd43b3
...
...
@@ -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'
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment