Attached patch introduces a new token_comment.inc file. I am using this in a new replies.module which does simple thread subscriptions. Its intended target is core. I will also need this soon when i convert organic groups to use token for its emails (and it will declare a few tokens too).

CommentFileSizeAuthor
mw_18.patch4.92 KBmoshe weitzman

Comments

moshe weitzman’s picture

Anyone up for reviewing this? Basically, just assure that your existing tokens doesn't blow up. Only replies.module uses this right now.

greggles’s picture

Status: Needs review » Fixed

uh, when I first tested this I got - "Parse error: syntax error, unexpected '=', expecting ')' in /var/www/m/drupal-5.1/sites/all/modules/token/token_comment.inc on line 33" But I think that was introduced somewhere by me...

I noticed these tokens:

$values['comment-body'] = check_markup($comment->comment, $comment->format);
$values['comment-body-raw'] = $comment->comment;

Which I think eaton is mixed about. In order for token to be used for mailers and such it needs to provide these tokens so while I'm somewhat mixed I don't see much downside to providing those tokens in general. Especially in this case where it doesn't cost much extra processing (e.g. no query).

See http://drupal.org/node/127613 for related issues on that topic. We can discuss this more in the future, but I don't want to hold back replies module.

Anonymous’s picture

Status: Fixed » Closed (fixed)