diff options
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/comment.module | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 96b399b77..b279ef324 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1442,6 +1442,11 @@ function comment_save($comment) { $comment->node_type = 'comment_node_' . $node->type; } + // Load the stored entity, if any. + if (!empty($comment->cid) && !isset($comment->original)) { + $comment->original = entity_load_unchanged('comment', $comment->cid); + } + field_attach_presave('comment', $comment); // Allow modules to alter the comment before saving. @@ -1568,6 +1573,7 @@ function comment_save($comment) { if ($comment->status == COMMENT_PUBLISHED) { module_invoke_all('comment_publish', $comment); } + unset($comment->original); } catch (Exception $e) { $transaction->rollback('comment'); |