hook_link_alter() in D6 can be used for nodes and for comments.
hook_link_alter(&$links, $node, $comment = NULL)
Have a look at comment.module, function comment_render() in D6
(I don't want to give line numbers, they could change with the Drupal build).
<?php
$links = module_invoke_all('link', 'comment', $comment, 1);
drupal_alter('link', $links, $node, $comment);
?>And now in advanced_forum.module, function advanced_forum_preprocess_comment()
<?php
$links = module_invoke_all('link', 'comment', $variables['comment']);
drupal_alter('link', $links, $node);
?>Correct would be
<?php
$links = module_invoke_all('link', 'comment', $variables['comment']);
drupal_alter('link', $links, $node, $variables['comment']);
?>------
Why is this relevant?
Because in my implementation of hook_link_alter(), I want to check whether I'm dealing with a comment or a node.
I need hook_link_alter(), because it is the only comment hook that has $node as a parameter in addition to $comment, so I can check for $node->type.
Comments
Comment #1
michelleThis code no longer exists so nothing to do here.
Michelle
Comment #2
donquixote commentedThen could we fix it on the 1.x branch? It's just a tiny and obvious fix...
Thanks.
Comment #3
mr.j commented++ It contributes to this bug in ajax comments which I believe won't work with 2.x anyway.
Comment #4
michelleCommitted, thanks. :)
Michelle