Please have a look at this feature request and do not automatically mark it as duplicate.
There were already feature requests to make the comment link to last unread comment when displaying COMMENT DATA.
But now I have got a request for NODE DATA.
When, for example, a view is listing nodes that were modified (changed or commented) since the last visit, there seems to be no possibility to link the node title to the last unread comment.
I know that there is a solution for this issue with comment data (based on the permalink module), but I do not want to use it since using fields belonging to comments result is a topic being displayed multiple times (if there were multiple comments to a single node since the last visit).
The node fields have things like "new comments" counting the new comments on the node, so in fact the database query has the info, which of the comments is the last unread one. But I see no obvious way to list it here.
P.S. With the permalink module being turned on the links to comments have a form like comment/2471#comment-2471

Comments

merlinofchaos’s picture

Status: Active » Fixed

The 'new comments' field actually contains a link to the last unread comment, I believe. That means you can use that field, click the checkbox to rewrite the field, and use a token from the node title. This should preserve the link while changing the text of the link.

__Sander__’s picture

Status: Fixed » Active

Unfortunately it is not working properly.
I've tried all variants and multiple version of views including the latest dev.
There are actually two problems
1) If I check "Rewrite the output of this field" and put [title] there, the field links to the node without paging and #new, no matter what follows
2) If there are no comments, this link is absent, and it would be nice if it pointed at the node itself in this case

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new1.8 KB

1) tryed to do the same with the nid field.
First it didn't worked, but then i realized that node: nid was linked by default to the node page.

So please export your view to be able to understand the issue 100%. It helps if you create a as easy as possible view with the problem, thanks!

2) This is a feature request, right, here is a patch for it.

__Sander__’s picture

Version: 6.x-2.9 » 6.x-2.12
Status: Needs review » Reviewed & tested by the community

Brilliant! Everything worked for me!

1) Indeed, if there are, say two columts
- [title] linked to its node
- [new_comments] with output replacement with [title] and linked to new comments
Then the second column also links to the node.
Is it a bug or a feature?
Anyway, it's easily avoided.

2) The patch worked perfectly for 6.2.12 and the latest dev. (first I had a feeling it did not work but then discovered the option "link to its node if there are no comments")

Thanks a lot.

By the way, that's been the active topics view from advanced forum. I will be creating an issue at the advanced topic soon suggesting to switch to this view style.

dawehner’s picture

1) it's a wrong usage: you have to uncheck the link, and it will work.

__Sander__’s picture

Status: Reviewed & tested by the community » Active

Sorry, but I am back here.
There is a small bug in the current setup.
If the view has no nodes with comments (all nodes shown with the current filter have no new comments), then the "new_comment" column links to the node itself but not to node#new. If there is at least one node with new comments, then everything works perfectly,

iamjon’s picture

Assigned: Unassigned » dawehner

Assiging to dereine for review

dawehner’s picture

Status: Active » Needs work
__Sander__’s picture

Updating the patch in this issue for 3.x

Are you planning to include it into the release?

merlinofchaos’s picture

Status: Needs work » Needs review

Be sure to change the status or people won't know to look.

__Sander__’s picture

Version: 6.x-2.12 » 6.x-3.0

The patch worked for me on views 3.0
Requesting to include it into the new releases :)

Status: Needs review » Needs work

The last submitted patch, 999196-node_new_comments-empty-link-3.patch, failed testing.

__Sander__’s picture

Cool! the automatic test system works now )

__Sander__’s picture

Status: Needs work » Needs review
StatusFileSize
new1.84 KB

ok... seems it should be passing with patch -p1

Status: Needs review » Needs work

The last submitted patch, 999196-node_new_comments-empty-link-4.patch, failed testing.

__Sander__’s picture

And what does this all mean?
How can a small patch originaly created by the authors of views and also working at my site produce 47 errors?
It's not even using the variables mentioned in error messages!

mustanggb’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)