function forum_comment_update

Same name and namespace in other branches
  1. 9 core/modules/forum/forum.module \forum_comment_update()
  2. 8.9.x core/modules/forum/forum.module \forum_comment_update()
  3. 10 core/modules/forum/forum.module \forum_comment_update()
  4. 11.x core/modules/forum/forum.module \forum_comment_update()

Implements hook_comment_update().

The Comment module doesn't call hook_comment_unpublish() when saving individual comments, so we need to check for those here.

File

modules/forum/forum.module, line 502

Code

function forum_comment_update($comment) {
  // comment_save() calls hook_comment_publish() for all published comments,
  // so we need to handle all other values here.
  if (!$comment->status) {
    _forum_update_forum_index($comment->nid);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.