I haven't yet been able to track this down. On a variety of sites for months now we get "n/a" instead of the comment-body token periodically and without pattern that I can find.

I see it on sites where the notifications are coming from "content type in group" and on sites where the notification is from "content type."

There are some old issues about this, though I'm not sure how relevant they are now because they are from 1 year plus and often relate tot he 5.x version.

CommentFileSizeAuthor
#2 717246_na_instead_of_token.patch783 bytesgreggles

Comments

greggles’s picture

On one of the sites I maintain this has become 100% consistent and is happening on every mail. Hopefully I'll have some more data on it soon.

greggles’s picture

StatusFileSize
new783 bytes

The problem is in token_comment.inc

It does a check_markup on the content and if the user running cron doesn't have access to the filter then it gets replaced with N/A.

I think this should be fixed in token_comment, but leave this here for a moment so you can comment on it.

jose reyero’s picture

@greggles, thanks, I think you're right, this is a token module issue.

Have yoiu posted it to token module or should we move the issue?

As a side note, Notifications 4.x now does user switching to anonymous before running a manual queue process that should help testing this one.

greggles’s picture

Project: Messaging » Token
Version: 6.x-2.x-dev » 6.x-1.x-dev
Status: Active » Needs review

Not yet - wanted to make sure you agreed on the cause.

Anyone in token care to review this prior to me committing it?

dave reid’s picture

I'm not sure about this. Are there security implications with the patch?

dave reid’s picture

Nevermind. It probably makes a lot of sense. This is what comment.module does itself for search indexing.

greggles’s picture

Status: Needs review » Fixed

Committed to 6.x - http://drupal.org/cvs?commit=352626

Here's the 7.x code:

        case 'body':
          $replacements[$original] = $sanitize ? check_markup($comment->comment, $comment->format, '', TRUE) : $comment->comment;
          break;

But in fact the signature of check_markup has changed and the responsibility to check permissions is now at the submit stage rather than the render stage, which I think makes a lot more sense: http://api.drupal.org/api/function/check_markup/7

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.