Comment links from third-party modules are wiped out
jbrauer - November 16, 2008 - 02:14
| Project: | Nitobe |
| Version: | 6.x-2.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Shannon Lucas |
| Status: | closed |
Jump to:
Description
The handling of comment links is causing contrib modules to fail to be able to add links. Specifically Mollom cannot add the abuse-reporting links. Commenting out the following line prevents this from occurring --
$variables['links'] = theme('links', comment_links($comment, 0), NULL, 'comment-meta');And commenting out this line breaks some of the theme's functionality like the ability to remove the reply link because it changes the results of nitobe_links()

#1
I remember I put that in there for a reason, but I don't remember what that was anymore.
In any event, the behavior definitely needs to get fixed. I'm raising the priority on it since this interferes with normal usage.
#2
It seems there's no place to intercept the link array before
template_preprocess_commentthemes the links. The solution is to rebuild the link array bycalling module_invoke_all. This fix will be incorporated in the next release.<?php
$linkage = module_invoke_all('link', 'comment', $comment);
$suppress_reply = (boolean)theme_get_setting('nitobe_suppress_comment_reply', FALSE);
if ($suppress_reply) {
unset($linkage['comment_reply']);
}
$links = theme('links', $linkage);
$variables['links'] = $links;
?>
#3
This fix is incorporated in the 6.x-2.0 release.
#4