Count tokens missing for users and comments
Flying Drupalist - October 30, 2008 - 04:40
| Project: | Flag |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
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.

#1
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.
#2
#3
(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.)
#4
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.
#5
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.)
#6
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.
#7
Nathan, are you ok with this patch?
#8
Looks good to me!
#9
Committed.
#10
Automatically closed -- issue fixed for two weeks with no activity.