When using the "Node: New comments" field, sometimes empty links are created even though "Display nothing if no new comments" has been checked.

As Views loops through the nodes to output, it works as intended until it comes across a node with no new comments after it has processed a node that does have new comments. The node that had new comments sets options['alter']['make_link'] = TRUE. This flag is not then cleared by a following node that has no new comments, so an empty link is created and sent to $fields['new_comments']->content with the linked URL relating to the new comments on the previous node. Whilst an empty link in itself may not seem such a big deal, it does mean that $fields['new_comments']->content is not always empty when it should be, which can mess with your theme.

The attached patch to views_handler_field_node_new_comments.inc should, I hope, fix this issue.

CommentFileSizeAuthor
views_new_comments_handler.patch504 bytesrb7

Comments

merlinofchaos’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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