I am writing a module that allows for a Subscribe/Unsubscribe links to be put in the links section of nodes (and comments if that setting is turned on). I (and some people in #drupal) don't think that the Subscribe/Unsubscribe links should be put in the teaser view of a node, so I wrote my module that way.

I ran into the problem that my module worked except for in the AF module. I did a bunch of troubleshooting and this is what I have found.

In the function advanced_forum_preprocess_comment() you build $links because it does not exist at that point. To do this you use the following call:

$links = module_invoke_all('link', 'comment', $variables['comment'], 1);

This is basically the equivalent of the following call:

SOMEMODULE_link($type = 'comment', $node = $variables['comment'], $teaser = 1)

I don't think that the comments should be treated as a teaser, so I think this call should be as follows. I am going to change it in my version and continue testing.

$links = module_invoke_all('link', 'comment', $variables['comment']);

Note: by not passing the $teaser variable it gets the default value of NULL.

Cheers...

Comments

michelle’s picture

Version: 5.x-1.0-alpha12 » 6.x-1.x-dev
Status: Active » Patch (to be ported)

Doesn't seem to break anything. :) Committed to 5.x. Still needs to be ported to D6 when I unhose my dev site.

Michelle

michelle’s picture

Status: Patch (to be ported) » Fixed

Committed to 6.x.

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)

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