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

mooffie - October 30, 2008 - 09:13

[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.

#2

mooffie - October 30, 2008 - 14:15
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 request» bug report
Status:active» needs review
AttachmentSize
user_and_comment_count_tokens.diff 1.84 KB

#3

mooffie - October 30, 2008 - 14:24

(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

Flying Drupalist - October 30, 2008 - 14:48

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

mooffie - October 30, 2008 - 15:25

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

Flying Drupalist - October 30, 2008 - 15:53

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

mooffie - October 30, 2008 - 16:05

Nathan, are you ok with this patch?

#8

quicksketch - October 31, 2008 - 01:41
Status:needs review» reviewed & tested by the community

Looks good to me!

#9

mooffie - October 31, 2008 - 08:37
Status:reviewed & tested by the community» fixed

Committed.

#10

Anonymous (not verified) - November 14, 2008 - 08:41
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.