The default "recent posts" view (views/tracker_tracker) sets up a table with a column labeled "Replies", with a handler of "With New Count". Therefore, as in the page created by the tracker module (/tracker), the user sees a column with the number of replies to a node. If there have been any new replies since the user last logged in, the user will see a "2 new" link if, for example, there have been 2 new replies to the node.

On the page from the tracker module, if the node is called "test_blog", the "2 new" link goes to the correct page of: http://www.example.com/test_blog#new .

In the views page, though, this link is formatted: http://www.example.com/node/#new , which is invalid and therefore, takes the user to the home page.

Comments

bobbia’s picture

The 'new comment' link is created in the "views_handler_comments_with_new" function, found near line 1912 in the 4.6 views.module. The current code for this function is:


function views_handler_comments_with_new($fieldinfo, $fielddata, $value, $data) {
  $comments = intval($value);
  if (module_exist('comment') && $comments && $new = comment_num_new($data->nid)) {
	  $comments = $node->comment_count;
    $comments .= '<br />';
    $comments .= l(t('%num new', array('%num' => $new)), "node/$node->nid", NULL, NULL, 'new');
  }
  return $comments;

Replacing the line:

$comments .= l(t('%num new', array('%num' => $new)), "node/$node->nid", NULL, NULL, 'new');

With this line:

$comments .= l(t('%num new', array('%num' => $new)), "node/$data->nid", NULL, NULL, 'new');

Fixes the problem.

Thanks!

merlinofchaos’s picture

Status: Active » Fixed

Committed this fix.

Anonymous’s picture

Status: Fixed » Closed (fixed)