hook_comment_publish() docs are completely wrong

Created on 6 September 2012, over 12 years ago
Updated 12 May 2023, over 1 year ago

The comment is being published by the moderator.

What actually happens is the hook is invoked every time a comment is saved and $comment->status == COMMENT_PUBLISHED - whether it was previously in a published state or not.

I got caught out by this when I wanted to trigger something on the change of status, and it ran every time instead.

We should fix the docs. But also we should just drop this hook in Drupal 8 since the only only thing it saves is an if check on $comment->status.

🐛 Bug report
Status

Fixed

Version

7.0 ⚰️

Component
Documentation 

Last updated about 6 hours ago

No maintainer
Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024