1

I don't fully understand how the rate module integrates with rules.

Here's my situation:

1) I created a widget of the type: Number up / down widget which allow users to vote in nodes of the Answer content type.

2) I created a rule which is fired in the event: User votes on a Node with the condition "Check the value of the vote" is "1"

3) A user "vote up" an Answer and the rule is fired.

So far so good...

The problem:

4) The same user "vote up" the same Answer and the vote is not added because the user only can give just one "vote up" per node, this is how the rate module works and it is all right. The problem is that the rule is fired even when the vote is not added, this is wrong, the rule should be fired only if the node get the vote.

Is this a bug? Do I have to add other condition to the rule?

1 Answer 1

0

It is not a bug. User voted up. His vote wasn't counted, but he voted all right. It might be used to update "last voted date" for example, or to give "forgetful" badge to an user who tries to vote many times on the same node. You either need to:

  1. Look for an event that fires when vote is actually saved
  2. Look for a condition that will let you filter out only new votes
  3. Add if in the code that actually gets fired
  4. If first two are not possible and third is to difficult, fill a feature request to add 1. or 2.

I'm deliberately not going to test these and find which one works, in hope future readers can benefit from algorithm for similar problems.

1
  • The event and condition mentioned in 1 and 2 are not available. I'll try to get into the code which fire the event. Maybe someone knows a shortcut for this inspired in the options that Molot posted
    – chefnelone
    May 17, 2013 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.