It looks like [flag-content-url] gets built incorrectly for comments.
It should be something like:
hxxp://example.com/node/200#comment-150 .
Instead, it's coming through as a link to :
hxxp://example.com/node/200/150#comment-150
where 200 is the nid and 150 is the cid.
Now, this won't work at all for comments that aren't on the first page of comments, but it would still be nice for it to work on posts which only have a few comments.
Another option to make it work correctly may be to build the link to go to the node for that comment that you'd use to reply to the comment, so something like:
hxxp://example.com/comment/reply/200/150
Background for this issue: I'd like my users to be able to flag particular comments, which then get sent to administrators in tokenized emails. I'm using flags, flag actions, flag abuse, and token actions.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 798152-flag_comment_link.patch | 770 bytes | dawehner |
Comments
Comment #1
dawehnerThats sadly also a bug in drupal 6.x. In drupal7 you can use comment/$id#comment-$id.
I guess this was introduced done where there was a fix on the site.
Comment #2
quicksketchThanks, looks good to me. We'll need to rewrite slightly for D7, since the second parameter to url() is now an array of options.
Comment #3
dawehnerDo you want the rerole of the patch for the 7.x before committing to 6.x?
Comment #4
quicksketchSure a reroll wouldn't hurt, but I can put it together next time I'm working on Flag so it's nothing to worry about.
Comment #5
mooffie commentedI'll deal with D7 in a separate issue because it's easy there.
Comment #6
mooffie commented#951164: D7: Fix flag-content-url is fixed so we can concentrate now on D6.
Comment #7
mooffie commentedBTW, why are you saying this? The current URL (e.g., node/200/150#comment-150) is correct AFAIK. It's just that it shows only a single comment. Is that the problem?
I don't mind switching to the proposed URL (e.g., node/200#comment-150) but it has the disadvantage that it may not point to the comment (e.g., if it's on the second page). Nate, do you want to switch to this URL (that is, do you want me to commit the patch at #1)?
Comment #8
mooffie commentedNate?
So,
Do you want me to commit the patch from #1?
Pros: The comment is seen "in context": with other comments around it.
Cons: This won't work for comments that aren't on the first page. The admin is going to receive an e-mail, click the link ...and not see the comment. That's bad.
(I know this issue is already marked RTBC, but perhaps people got the wrong impression, as the title of this issue claims, that the current URL is wrong: not so; the current URL works.)
Comment #9
quicksketchThe current behavior isn't a bug, it works totally fine. It shows the node first, then just that comment. Unfortunately it doesn't show the comment in-line with all the other comments, but at least it always shows the comment as expected. I think the current behavior is correct and shouldn't be changed. I never checked that the link was actually broken when I marked RTBC, as it turns out I think the current approach is better than the suggested one.
Comment #10
mooffie commentedThat's also been my opinion.
Let's mark this "wontfix".
Comment #11
quicksketch