diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 9cff21e..0c47af1 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1502,10 +1502,6 @@ function comment_save($comment) { // Allow modules to respond to the updating of a comment. module_invoke_all('comment_update', $comment); module_invoke_all('entity_update', $comment, 'comment'); - // Allow modules to respond to the publishing of a comment. - if ((!isset($comment->original) || $comment->original->status != $comment->status) && $comment->status == COMMENT_PUBLISHED) { - module_invoke_all('comment_publish', $comment); - } } else { // Add the comment to database. This next section builds the thread field. @@ -1592,6 +1588,10 @@ function comment_save($comment) { module_invoke_all('comment_insert', $comment); module_invoke_all('entity_insert', $comment, 'comment'); } + // Allow modules to respond to the publishing of a comment. + if ((!isset($comment->original) || $comment->original->status != $comment->status) && $comment->status == COMMENT_PUBLISHED) { + module_invoke_all('comment_publish', $comment); + } unset($comment->original); } catch (Exception $e) {