I could not found any hook invocation for the unpublish hook, so it won't work. So attached patch removes the wrong docs.

Additionally comment publish is invoked during comment_save(), however the docs don't really fit to that as it talks about moderators. I wonder why we need that separate hook too as we have insert/update/presave as for nodes? I see no reason to that, so attached patch removes that hook (which has not been there in previous drupal versions).

CommentFileSizeAuthor
comment_hooks.patch1.49 KBfago
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, comment_hooks.patch, failed testing.

fago’s picture

Obviously tracker module implements hook_comment_publish(). Any comments about removing this that late in the cycle? Well, I doubt lots of people use it already as it does not what the docu says.

sun’s picture

Title: remove separate comment publishing hooks » Remove separate comment publishing hooks or fix them
Issue tags: +DrupalWTF

I tried to use those hooks in the Mollom module, but they are total entire complete nonsense.

To make any sense of them, comment_save() would have to reload the already existing $comment object into $comment->original when updating an existing comment, and also provide a stub comment in $comment->original for new comments.

Otherwise, $comment->status is always COMMENT_PUBLISHED once a comment has been published. Thus, hook_comment_publish() is invoked all over and all over again. Stupid.

snupy’s picture

Subscribe.

dixon_’s picture

Version: 7.x-dev » 8.x-dev
mradcliffe’s picture

Status: Needs work » Closed (duplicate)

#1777166: hook_comment_publish() docs are completely wrong is a duplicate of this issue, but more recent so I'm closing this one.