How do I return the number of flags a user has? I've set a 'fan' flag to allow users to be flag to become fan. This, [flag-fan-count], which works for nodes, do not seem to work for users. Does anyone have any advice? Thanks.

CommentFileSizeAuthor
#2 user_and_comment_count_tokens.diff1.84 KBmooffie

Comments

mooffie’s picture

[flag-fan-count], which works for nodes, do not seem to work for users

You're right. The [flag-xxx-count] tokens don't work for users and comments yet. I was aware of this glitch. The fix is very simple and will come soon.

mooffie’s picture

Title: Return number of user flags? » Count tokens missing for users and comments
Version: 6.x-1.0-beta4 » 6.x-1.x-dev
Component: User interface » Code
Category: support » bug
Status: Active » Needs review
StatusFileSize
new1.84 KB
mooffie’s picture

(BTW, Miraploy, you report that you're using beta4. Count tokens in labels work correctly starting with beta5 only (see digg recipe). That's because earlier versions "pre loaded" the labels' text.)

Flying Drupalist’s picture

Hi mooffie, I'm actually using the 17th dev, between beta4 and beta5. The count works on nodes for me. I can't upgrade to the latest dev because I need the rules integration, from here: http://drupal.org/node/298109, which afaik don't have an updated patch.

As rules is vital for me I'll have to wait for a reroll of that before I can test this patch. Thanks for the quick fix.

mooffie’s picture

I re-rolled the Rules patch.

(But you could apply this tokens patch without fear: it touches only 'flag.token.inc', which hasn't changed recently.)

Flying Drupalist’s picture

Hi, thanks for the rules reroll. I applied that patch fine, but this one says flag.token.inc file does not exist. So I changed the index to Index: includes/flag.token.inc.

And it works! Thanks a lot.

mooffie’s picture

Nathan, are you ok with this patch?

quicksketch’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me!

mooffie’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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