I'm trying to use Rules to award user badges to site members for user generated content. I've installed User Badges, Userpoints, Userpoints Contrib, and Rules; and I have enabled UserPoints nodes and comments, Userpoints Rules Integration, and Userpoints Retroactive.
Everything seems to be in place, but after running Userpoints retroactive to award points for existing content, no badges are awarded. Before I look into the other module pieces, I wanted to make sure my Rule set was working the way I think it should. Here is what I thought was correct:
Triggered Rules:
IF
Badgename
->Userpoints amount is >= than x
-amount to compare:100
->Userpoints Categories to analyze:
-Badgename category
DO
->selected my badge icon
It seems like that would be the rule set to add a badge, but it doesn't seem to work. I've tried running retroactive, cron and flushed all caches, but the Rule doesn't seem to be taking hold. I can manually add the badges to make them appear on the member's profile, but that obviously is negating the Rule workflow. Is there something I am missing?
Comments
Comment #1
hokuspokus commentedChecking the documentation and examples from here http://drupal.org/node/874392, it seems that I have the Rule set up correctly:
And to check if points were deducted from the user:
Event: Userpoints - User was awarded points
Condition: Userpoints - Compare the transaction amount / Negate: checked / Amount to compare: 0
Action: // whatever you choose
The only deviation I made was to change the amount to compare was from 1 to 100 since I wanted the action to occur on a higher trigger.
Is there a way to test whether Rules are working, like logging the actions or errors?
Comment #2
hokuspokus commentedI was able to get it working, though not through rules. One of the Userpoints contrib modules specifically works the badge awarding magic. Still uncertain why the Rules workflow didn't work, but I guess I'll save that mystery for someone else.
Comment #3
meustrus commentedIt could be that the Userpoints Retroactive module does not trigger Rules. I think that's the most likely.
Comment #4
tbillion commentedmaybe try having the event triggered by cron? i am having a problem getting it to remove the badges when their points fall below a certain amount, or giving access to content based on a badge.
@a few hours after post i find this committed patch that make it remove the non eligible badges. except i am using the version the patch is supposed to be in and the patch isnt there... lmao see http://drupal.org/node/880120