Change record status: 
Project: 
Introduced in branch: 
7.x
Introduced in version: 
7.93
Description: 

Drupal 7's comment API includes a hook for both publish and unpublish:

https://api.drupal.org/api/drupal/modules%21comment%21comment.api.php/7.x

However, previously hook_comment_unpublish() was not actually implemented in the comment module.

It now is.

If your site or module implements this hook, it's likely that is has never worked. However, it will now be invoked by the comment module. In some cases this could have unexpected consequences.

Please note that although the API documentation suggests that the publish / unpublish hooks fire when the published state of a comment changes, it is in fact the case that the hooks fire every time a comment is saved whether the status has changed or not. This functionality has not been changed in Drupal 7 yet, but may be in the future - see: #1777166: hook_comment_publish() docs are completely wrong.

Note also that these hooks were removed / superseded in Drupal 8: https://www.drupal.org/node/2296867

Impacts: 
Site builders, administrators, editors
Module developers
Site templates, recipes and distribution developers