Hi All - I am hoping someone may be able to help me with a quick hook_comment question.

In my module i have implemented hook_comment (http://api.drupal.org/api/function/hook_comment/6) as follows:

/**
 * Implementation of hook_comment
 */
function mymodule_comment(&$a1, $op) {
    switch ($op) {
    case 'insert':
          $a1['comment'] ='changed here';
      break;
    }
}

What I am expecting is that the comment text will be replaced by the text "changed here". However, this never happens, and the comment text is always unchanged.

I've also tried all the other $op operations, but regardless the comment is never changed by my code.

What am I doing wrong?

Jeff

Comments

theabacus’s picture

Anyone have any thoughts on this? I am having the same exact problem.

LuckyBamboo’s picture

I'm having the same problem.

hook_comment() works fine for 'view', but not for 'insert'.

any clues why?