Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
comment data
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2010 at 01:01 UTC
Updated:
4 Oct 2011 at 16:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
dawehnerFix comment-link path.
Comment #2
dave reidYep, that's the correct link for comments as per comment_uri().
Comment #3
dawehnerThanks.
Commited to the 7.x branch.
Comment #5
troky commentedReopening this because of situation where CID is undefined or 0. For example: using comment view link in "Last Comment" relation when node doesn't have any comments.
Resulting link is:
http://<site>/comment/#comment-There are two possible solutions when CID is empty:
1. return empty string
2. return link to node itself like:
http://<site>/node/{nid}Comment #6
dawehnerWhich version do you use?
I'm pretty sure that's a problem of your configuration. So do you have "node" or "comment" as type of the view?
Comment #7
dawehnerIn general i commited a fix currently for the field_comment.inc not field_comment_link.inc which might fix the issue, too.
So please text the current git version or wait a bit for the next dev image.
Comment #8
troky commentedI am using latest dev.
Patched field_comment.inc won't fix this issue because comment link is created separately in both files and not related.
I don't see any problem in configuration because it is perfectly normal to have node without comments so "last comment cid" returns 0 or undefined and that case is not handled well in views_handler_field_comment_link.inc.
To be specific, I have modified Advanced Forum (topic list) view and in "Last post" column I want to have (beside timestamp and author) link to latest comment. If there are no comments at all
http://<site>/comment/#comment-is returned so I can't even "hide when empty".I made this modification in views_handler_field_comment_link.inc:function render_link:
before:
after:
... so returned link is always correct.
That 'else' could look like
and one can use "hide when empty" option to handle data...
Comment #9
dawehnerThis should be sure configurable and default to FALSE.
But there should be no link by default if $cid is empty because this always is wrong.
Comment #10
troky commentedNice idea but not working for me...
If $cid is empty, $data is empty and function returns NULL instead of link to node.
changed above code to:
and have link to node set to "node/" because $nid is empty as well.
Comment #11
dawehnerIt's somehow kind of cool that you tested and reviewed this patch, thanks!
Okay so what about this, removing the $data check, as the $cid will happen here anyway.
Comment #12
troky commentedthis looks good.
Comment #13
dawehnerThanks for testing the patch. Commited to 7.x-3.x