Please, check out this issue I have just opened for Drupal core:
http://drupal.org/node/50827

It may save commentmail (and probably any other module that implements hook_comment) from reading the comment that has just been inserted into the database.

Comments

sun’s picture

Status: Active » Fixed

Drupal core issue seems to be fixed, thus closing this issue.

markus_petrux’s picture

Status: Fixed » Active

...so the fix in core makes it possible to remove the call to _comment_load() in hook_comment('insert') since the $comment argument has all the information just inserted by the comment module before invoking the hook.

junyor’s picture

Version: master » 5.x-0.1
Status: Active » Needs review
StatusFileSize
new3.99 KB

Here's an untested patch that implements this change.

junyor’s picture

And now a tested patch. The $comment variable passed in is an array, not an object.

add1sun’s picture

Status: Needs review » Fixed

This change was in core for D6 so we won't do this in the D5 version. This new change has be added as part of the upgrade to 6 issue #188698: Port to 6.x.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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