This function is a poor clone of comment_link looks like it needs a bit of an overhaul. The 'parent' link looks like it just links to itself and it's using $comment as the variable instead of just $node.

CommentFileSizeAuthor
#3 nodecomment_links.patch3.82 KBquicksketch

Comments

merlinofchaos’s picture

Category: bug » task
merlinofchaos’s picture

Issue tags: +DruBB

Adding tag

quicksketch’s picture

StatusFileSize
new3.82 KB

I did some basic cleanup to nodecomment_links(), but there's some very suspicious logic going on in hook_link(). We've got a segment of code like this:

      if ($teaser) {
        $links = nodecomment_links($node, 0);
      }
      else {
        $links = nodecomment_links($node, $teaser);
      }

As you can figure, we have this IF statement, but the same values are passed in either way (the second parameter will always be 0). This is the only place in the module where the nodecomment_links() function is called, so I wonder if we need the extra function at all, and if we need to have the $parent parameter, since it was never used anyway.

Anyway, attached is the patch that has been committed so far, we still need some more work on this issue.

merlinofchaos’s picture

Ok, I understand this now.

comment.module, you could visit node/25/271 and if 271 was a valid $cid for that node, you would view just that one comment. In this incredibly never used instance, there would be a 'parent' link in the comment links section to go back to the node.

This is silly. I'd say we just remove that, *but* we should make sure that comments put their node parent in the breadcrumb so they can go back to the node parent that way. Which also leads to: We may need to do something to ensure that a node comment gets the full breadcrumb trail that the node would've gotten, which may actually be difficult because breadcrumbs are often added on node view. Maybe we could accomplish this by running a nodeapi view op for the parent node when viewing the page for a comment node, without actually rendering the parent node.

merlinofchaos’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -DruBB

Automatically closed -- issue fixed for 2 weeks with no activity.