Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
comment_hooks.patch | 1.49 KB | fago | |
Comments
Comment #2
fagoObviously 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.
Comment #3
sunI 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.
Comment #4
snupy CreditAttribution: snupy commentedSubscribe.
Comment #5
dixon_Comment #6
mradcliffe#1777166: hook_comment_publish() docs are completely wrong is a duplicate of this issue, but more recent so I'm closing this one.