I would like to write a hook to send a reject E-mail whenever a comment is deleted. However, hook_comment only recognize "insert", "moderate" and "update" operations. Please consider adding a "delete" action as well.

CommentFileSizeAuthor
#4 core.patch.txt846 bytesnaudefj

Comments

killes@www.drop.org’s picture

Version: 4.7.1 » x.y.z

features go into CVS.

I think it might be possible to fire such an action on the submit of the form through form API.

naudefj’s picture

Looks like hook_comment delete is already implemented in code. However, it is not listed in the API documentation.

What steps should I follow to get the API (http://api.drupal.org/) updated.

webchick’s picture

Title: Add a hook_comment delete action » Add a hook_comment delete action to API docs
Project: Drupal core » Documentation
Version: x.y.z »
Component: comment.module » Documentation in CVS
Category: feature » bug

If you have CVS access, you can simply update the appropriate documentation file in /contributions/docs/developer/hooks, and then commit it.

You might want to check if there are other missing ops too, while you're at it.

naudefj’s picture

Status: Active » Needs review
StatusFileSize
new846 bytes

Thank you very much webchick!

I do have CVS access. However, I need someone to just check the patch before I commit it.

brunodbo’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Documentation in CVS » documentation
brunodbo’s picture

Changed the component to reflect the new component categorization. See http://drupal.org/node/301443.

catch’s picture

Status: Needs review » Fixed

Patch looks fine to me, please go ahead and commit it if it still applies. Marking as fixed so it doesn't end up in the core rtbc queue.

catch’s picture

Status: Fixed » Reviewed & tested by the community

webchick wants this left at rtbc.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Looks like this has already been corrected by someone. I checked DRUPAL-5, DRUPAL-6--1, and DRUPAL-7 already has this documented as a separate hook (hook_comment_delete()).

Marking fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.