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.

CommentFileSizeAuthor
#1 798152-flag_comment_link.patch770 bytesdawehner

Comments

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new770 bytes
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.

Thats 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.

quicksketch’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good to me. We'll need to rewrite slightly for D7, since the second parameter to url() is now an array of options.

dawehner’s picture

Do you want the rerole of the patch for the 7.x before committing to 6.x?

quicksketch’s picture

Sure 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.

mooffie’s picture

Title: For flag_actions, flag-content-url does not link correctly to comment urls » D6: flag-content-url does not link correctly to comment urls
Assigned: Unassigned » mooffie

I'll deal with D7 in a separate issue because it's easy there.

mooffie’s picture

#951164: D7: Fix flag-content-url is fixed so we can concentrate now on D6.

mooffie’s picture

It looks like [flag-content-url] gets built incorrectly for comments.

BTW, 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)?

mooffie’s picture

Nate?

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.)

quicksketch’s picture

Title: D6: flag-content-url does not link correctly to comment urls » D6: Change flag-content-url to link to comments inline
Category: bug » task

The 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.

mooffie’s picture

I think the current approach is better than the suggested one.

That's also been my opinion.

Let's mark this "wontfix".

quicksketch’s picture

Status: Reviewed & tested by the community » Closed (won't fix)