Closed (fixed)
Project:
Token
Version:
5.x-1.9
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
11 Jan 2008 at 18:42 UTC
Updated:
31 Jul 2008 at 04:46 UTC
Jump to comment: Most recent file
I'm not sure if the token_comment.inc file provides this in a way I just missed, however... The attached (one line) patch provides a token for a comment's cid. This is useful for providing direct links to a comment like: [node-url]#comment-[comment-cid]
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | token_comment.inc_.patch | 1.17 KB | ricflomag |
| #2 | token_comment.inc_.patch | 1.17 KB | ricflomag |
| token_cid.patch | 583 bytes | jmiccolis |
Comments
Comment #1
gregglesThanks for the idea and the patch.
I believe this needs an entry in the comment_token_list function as well, right? That way people will know about it.
Otherwise this looks good to me.
Comment #2
ricflomag commentedI guess it should be considered a bug instead of a feature request: the helper text for 'comment-nid' says "Comment ID", which i suppose should return the cid property of the comment instead of the nid.
Anyway, here is a complete patch that corrects the helper text for 'comment-nid' and adds a 'comment-cid' token.
Comment #3
gregglesLooks like some weird whitepsace issues on the beginning of the $values['comment-cid'] = $comment->cid; line that come from tabs.
I believe that the \'s can cause problems for the internationalization extractor or for locale module or something like that.
So, t('Comment\'s node ID'); is better as t("Comment's node ID");
Can you re-roll? I agree, this is a bug given the misleading current token.
Comment #4
ricflomag commentedDone, thanks.
Comment #5
GoofyX commentedThe patch that ricflomag provides in #4 should be committed, as instead of comment id, the latest stable (5.x-1.11) still returns the commented node's id instead of the cid.
Thanks.
Comment #6
gregglesAgreed. Note to ricflomag - if you upload an updated patch please set it back to "patch (code needs review)" so it's more likely to catch my attention.
Thanks, jmiccolis, GoofyX, and ricflomag, for your work in providing and testing this patch. I've now fixed it in 6.x http://drupal.org/cvs?commit=127490 and 5.x http://drupal.org/cvs?commit=127489
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.