Hi,

I'm using the flags module with tokens to count the number of users that flagged content.

For example:

Like ([comment:flag-comment-likes-count])

This works fine when Drupal caches are disabled, no JS compressions, etc. It shows "Like (14)" etc.
But once you turn on these caches, the token often breaks and looks like "Like ([comment:flag-comment-likes-count])" on the frontend.

Is this a flag issue, a token issue, or...?

Comments

Dave Reid’s picture

Project: Token » Flag
Version: 7.x-1.x-dev » 7.x-2.x-dev
Component: Code » Token integration

You would have to ask Flag module as we don't provide the token that either calls token_replace() nor provides the code that provides the values for flag tokens.

quicksketch’s picture

Status: Active » Postponed (maintainer needs more info)

I can't confirm this problem. I set up a flag that was available to anonymous users (after enabling Session API) with the string "Flag as offensive ([comment:flag-offensive-comment-count])". Where the machine name of my flag was "offensive_comment". Everything worked just fine with the anonymous page cache enabled, both as a logged in user and as a logged out user. This was against the latest dev release of Flag though, perhaps something has been fixed since the last official release.

quicksketch’s picture

Marked this issue as duplicate (pretty much the exact same symptoms): #1234874: Tokens in flags texts breaks often when Drupal caches enabled

Anonymous’s picture

@quicksketch, will try to test again soon. In my case it happened for logged in users, we were using Memcached.

quicksketch’s picture

Perhaps it's unfair that I hadn't responded to this issue in a long time and now I'm impatient, but normally I'd close an issue after 2 weeks at maintainer needs more info. If you need more time you can reopen the issue again later, but for now I'll let this go a while more.

Anonymous’s picture

Hi in #3 this issue was marked as a duplicate of itself. Was there another thread you meant to reference?
You can close this and I'll file a new issue if it happens again.

quicksketch’s picture

Yes I meant to link to #1185528: Flags, token and cache don't work well, which was the issue marked duplicate.

Jessica A’s picture

I have this issue as well.

It also displays the token's name i.e. "[node:flag-vote-count]" on the node creation preview page.

a.siebel’s picture

I have this issue too.

I think it only appears in my (flagged) views embedded in panels. (I thougth wrong)

In some views I can't flag content if the view is cached - But not sure, what is the condition.

joachim’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing old bugs where no further information was supplied.