I don't know how this could go unnoticed this whole time, but I am positive that the logic for adding the 'comment-new-comments' link in comment_node_view() is actually the wrong way round:
$new = comment_num_new($node->nid);
if (!$new) {
$links['comment-new-comments'] = array(
'title' => format_plural($new, '1 new comment', '@count new comments'),
// …
comment_num_new() will return 0 if there are no new comments or FALSE if the user isn't logged in – resulting, for me, in links "0 new comments" and " new comments" being displayed.
However, if the user is logged in and there are new comments, no such link is displayed. And the code above seems to agree.
If this really is the case (and I didn't overlook something):
- this has been round since at least late Alphas
- as said, I can't possibly imagine how this could go unnoticed for such a long time
- we definitely shouldn't ship with this, as it would be really embarassing – making this major, I think
- the attached patch would fix this
But probably I just overlooked something again and will (or, rather, this issue will) be banished into the dark "closed (works as designed)" realm …
| Comment | File | Size | Author |
|---|---|---|---|
| comment-new-comments.patch | 713 bytes | drunken monkey |
Comments
Comment #1
drunken monkeyComment #2
montesq commentedActually, this bug appeared in the patch to fix the issue #775220. After flying over this ticket, I guess it's a mistake.
Anyway, this fix is OK for me, that means:
- when I create a new comment on a node with the user A and then connect with the user B, the link "new 1 comment" is displayed
- After reading the content of the node and go back to the list of nodes, the links has disappeared
- when I create 2 new comments with the user A, the user B sees "2 new comments"
- as anonymous user, the link "new comment" is never displayed
Comment #3
dries commentedCommitted to CVS HEAD. Thanks.