Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
11751c15
Commit
11751c15
authored
Apr 16, 2010
by
Dries
Browse files
- Patch
#757288
by catch, jpmckinney: optimize comment_save().
parent
45dbfaf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/comment/comment.module
View file @
11751c15
...
...
@@ -1243,16 +1243,20 @@ function comment_node_prepare($node) {
* Implements hook_node_insert().
*/
function
comment_node_insert
(
$node
)
{
db_insert
(
'node_comment_statistics'
)
->
fields
(
array
(
'nid'
=>
$node
->
nid
,
'cid'
=>
0
,
'last_comment_timestamp'
=>
$node
->
changed
,
'last_comment_name'
=>
NULL
,
'last_comment_uid'
=>
$node
->
uid
,
'comment_count'
=>
0
,
))
->
execute
();
// Allow bulk updates and inserts to temporarily disable the
// maintenance of the {node_comment_statistics} table.
if
(
variable_get
(
'comment_maintain_node_statistics'
,
TRUE
))
{
db_insert
(
'node_comment_statistics'
)
->
fields
(
array
(
'nid'
=>
$node
->
nid
,
'cid'
=>
0
,
'last_comment_timestamp'
=>
$node
->
changed
,
'last_comment_name'
=>
NULL
,
'last_comment_uid'
=>
$node
->
uid
,
'comment_count'
=>
0
,
))
->
execute
();
}
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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