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
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

Shannon Lucas - November 20, 2008 - 12:21
Priority:normal» critical
Assigned to:Anonymous» Shannon Lucas

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

Shannon Lucas - November 23, 2008 - 21:48

It seems there's no place to intercept the link array before template_preprocess_comment themes the links. The solution is to rebuild the link array by calling 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

Shannon Lucas - November 23, 2008 - 22:49
Version:6.x-1.8-beta1» 6.x-2.0
Status:active» fixed

This fix is incorporated in the 6.x-2.0 release.

#4

Shannon Lucas - November 23, 2008 - 22:49
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.