Comment links don't work - possible solution

jaron - May 27, 2009 - 22:05
Project:Forum Thread
Version:6.x-1.1
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

It seems that the links to the comments don't actually link to the comment, only to the original topic. I tried using the patch for link_alter that was posted for 6.x-1.dev, but that didn't change anything. (I will admit that coding baffles me, so perhaps that has nothing to do with it.) The issue is that the link that is created by the comment title is something like: drupal6_11/node/85#comment-2 ; but the actual link to the comment is: drupal6_11/node/85/2#comment-2. It seems like the construction of the link gets messed up. Is this a conflict with other settings I have? Any help would be appreciated. I really like the module.

#1

jaron - May 28, 2009 - 23:12
Assigned to:jaron» Anonymous

#2

cricketfan1 - November 13, 2009 - 15:50
Priority:normal» critical

Jaron,

I'm having this same problem...it there a fix for this? Please let me know, thanks

#3

jaron - November 24, 2009 - 21:11

never found a solution. just went a different direction for my site that didn't use forum thread. sorry. would still be interested if someone did solve it.

#4

su1001 - November 26, 2009 - 12:33
Title:Comment links don't work» Comment links don't work - possible solution

I installed Drupal for the first time just a couple of weeks ago (so I am still a newbie) and I am amazed of the many useful modules I stumbled upon so far.
One of these is Forum Thread, but I could not get the links of the comments to a specific forum topic point to the correct comment.
It had the mentioned form

like: drupal6_11/node/85#comment-2 ; but the actual link to the comment is: drupal6_11/node/85/2#comment-2

A look into the database showed the correct entries - a far as I understand them ;-)
Having fiddled around for quite a while, I am pretty sure the comment links are only displayed incorrectly by the forumthread.module.

First, I changed function get_node_comments($nid, $cid = 0) as advised in http://drupal.org/node/343486 to use
drupal_alter('link', $links, $node);
and added $node to
$output .= theme('comment_view', $node, $comment, $links);
because I thought it might me missing ;-)

Nothing changed, so I changed the following line in function theme_forumthread($topics)
from
$output .= '<li class="response">'. l($comment->subject, 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)) .' - ';
to
$output .= '<li class="response">'. l($comment->subject, 'node/'. $comment->nid.'/'.$comment->cid, array('fragment' => 'comment-'. $comment->cid)) .' - ';

so the comment's cid is inserted with a trailing '/' before the array('fragment'-stuff.

This seems to solve the problem for me !

It would be great if this could be tested and included into the module !
Forgive me my unability to post a patch ...

 
 

Drupal is a registered trademark of Dries Buytaert.