hook_link_alter was patched in Drupal 6.16 to allow it to modify comment links.

We need to replace the current implementation that goes through the theme system to use this method instead.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zero1eye’s picture

I would love to see this as well since removing the reply link doesn't currently work for me.

meustrus’s picture

Subscribing. This causes the option to have no effect when Advanced Forum is installed.

dragonwize’s picture

To all including future subscribers: While I appreciate you showing support for this task I do not need to be convinced of its validity. I filed this task as a reminder for myself, a project maintainer, to complete it. So I need time or help not convincing.

meustrus’s picture

I can help if the module is simple enough to understand. Just, direct me so I can focus on coding instead of finding my way around yet another module.

zero1eye’s picture

In the meantime, I was able to hide the button through css. Obviously the reply page can still be reached by going directly to the url.

.en .comment_reply a {
display: none;
visibility: hidden;
}

rsaddington’s picture

Status: Active » Needs review
FileSize
1.1 KB

Attached patch resolves this issue, tested with advanced forum.

rsaddington’s picture

Category: task » feature
dragonwize’s picture

Category: feature » task
meustrus’s picture

Excellent. Maybe a small revision...use strpos instead of strstr:

Note:

If you only want to determine if a particular needle occurs within haystack, use the faster and less memory intensive function strpos() instead.

http://php.net/manual/en/function.strstr.php

Will there be a new version with this patch? Are there other issues waiting to be committed?

dragonwize’s picture

Thanks for the patches. I have committed the work with some changes of my own. Should show up in the dev release when the process runs.

I am not marking this fixed yet because I think it still needs some more testing before I am ready to push this out in a point release.

I was testing on 6.16 and was not getting the 3rd argument which is supposed to be the comment. Need to test in other versions and see if that is still true. Maybe a bug.

Since we are not sure if we are on a comment or not the link may be removed from nodes as well which would not be ideal. Need to test.

meustrus’s picture

I've seen conditional code in another project testing if Drupal core is at least version 6.17, and if not using the old comment_preprocess method. It could be that the $comment variable is not used prior to 6.17 .

EDIT: I got a link to a closed issue with this problem: #374463-47: Alter comment links. The particular comment linked to says that prior to 6.16, hook_link_alter was not called for comments except in single view (such as when replying to a specific comment). Later, #53 suggests the addition of the $comment variable, which was committed in 6.17 .

clashar’s picture

what would be solution for D7?

dragonwize’s picture

D7 has hook_comment_view_alter() which is already used in the D7 version.