Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#9 | flatcomments_use_hook_link_alter.patch | 1.11 KB | meustrus |
#6 | flatcomments_use_hook_link_alter.patch | 1.1 KB | rsaddington |
Comments
Comment #1
zero1eye CreditAttribution: zero1eye commentedI would love to see this as well since removing the reply link doesn't currently work for me.
Comment #2
meustrus CreditAttribution: meustrus commentedSubscribing. This causes the option to have no effect when Advanced Forum is installed.
Comment #3
dragonwize CreditAttribution: dragonwize commentedTo 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.
Comment #4
meustrus CreditAttribution: meustrus commentedI 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.
Comment #5
zero1eye CreditAttribution: zero1eye commentedIn 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;
}
Comment #6
rsaddington CreditAttribution: rsaddington commentedAttached patch resolves this issue, tested with advanced forum.
Comment #7
rsaddington CreditAttribution: rsaddington commentedComment #8
dragonwize CreditAttribution: dragonwize commentedComment #9
meustrus CreditAttribution: meustrus commentedExcellent. Maybe a small revision...use strpos instead of strstr:
Will there be a new version with this patch? Are there other issues waiting to be committed?
Comment #10
dragonwize CreditAttribution: dragonwize commentedThanks 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.
Comment #11
meustrus CreditAttribution: meustrus commentedI'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 .
Comment #12
clashar CreditAttribution: clashar commentedwhat would be solution for D7?
Comment #13
dragonwize CreditAttribution: dragonwize commentedD7 has hook_comment_view_alter() which is already used in the D7 version.