Integration with Rules
Flying Drupalist - October 9, 2008 - 16:01
| Project: | Voting API |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
| Issue tags: | rules integration |
Description
Does Voting API have rules integration?

#1
Any news on this ? Has anyone done a votingapi integration of rules ?
#2
I've done a partial integration of votingapi with rules. It works enough for me to use it with the activity_log module. Here is the patch against rc2.
Included
Not done : update/delete of votes
Can I get some feedback and some indication from the maintainer as to how this could be merged into the D6 branch ?
#3
Forgot to change the status
#4
I think your patch is missing the .rules.inc file.
#5
Sorry about that. I've attached it directly to this reply
#6
+1
#7
This issue will likely be better served spending some time in the Rules issue queue.
#8
The file attached to #5 uses the function prefix inconsistently; first it uses vote_, and then it uses votingapi_.
The attached file must be renamed votingapi.rules.inc.
#9
#10
I don't understand why the issue is in the Rules issue queue; it should be rather be in the Voting API queue.
#11
@Kiam: I agree it should be in the Voting API queue, however
It seems right that this issue should belong to the Rules developers, for now.
#12
+1 for the integration with Voting API.
#13
Have a look at http://drupal.org/node/298639. You should set 'uses_input_form' to FALSE or add the default input form method to your class. If you keep your class empty, remove it and use just the usual class.
@token: I think you should use $type = 'all' when listing, not when generating values.
This should move back to votings api at least once it is ready, so it gets included there.
#14
Moving back to Voting API issue queue and tagging with taxonomy term 'rules integration.'
Other modules in the process of integrating with Rules can be found here: http://drupal.org/project/issues-term/750
#15
Any news on this, are we able to replicate the voting actions module using rules??
thanks a lot!
#16
+1
#17
Marked #79266: Actions Integration as a duplicate of this issue, and marked #229869: Voting Actions: 6.x Port as won't fix.
As far as I can tell of what remains for this patch:
Let's cross that bridge when we get there. Eaton is very busy, but if we get patch to RTBC, several people can commit it.
#18
subscribing
#19
can someone else take care of this ? I've moved on to something different and do not require making the recommended changes where I used this
#20
subscribing
#21
There is the Flag module that would allow you to build a Digg-like! Maybe something to look at for people that don't need Voting API specifically....
http://drupal.org/node/319491
I would still love to see Voting API integrated in rules module so that way we could build more advanced digg-like systems...
Patchak
#22
+1 subscribing
#23
#24
Does the patch in #8 still work with the latest 2.x? What about 2.0 RC-2 (which I'm using)?
#25
This should be reworked into votingapi.rules.inc but where to put hooks for insert and delete votes?
#26
Too bad we had a nice module voting actions that is abandonned... It's just impossible to have content promoted to the front page now in d6 expect using the flag module which does not seem ideal. :(
Hopefully I can find some funds to actually sponsor this as it seems badly needed!
#27
I agree. I'll pitch in some funds to the effort. Anyone else?
#28
@kirkcaraway : great, glad to hear it. Now we just need someone with the ability and the time to actually do a proper, working solution! Anyone in this thread interested in making an offer to finish this patch and make it work perfectly for d6??
Patchak
#29
subscribing
#30
I am working on a project right now that needs Rules integration with VotingAPI.
Currently I am reviewing the patch and updating it so it works as expected.
Can anyone intersted in this patch offer some Use Cases? I am only added the event "User added a vote', but of course others are possible.
I will keep this thread up to date with my status.
Cheers,
David
#31
David a good use case would be "votes exceed #" and even better to make many modules have the same functions as digg is "votes exceed # within X period"
#32
My use case brainstorm:
Events
Conditions
Actions
All that would be applicable to voting on anything, not just nodes.
#33
subscribing
#34
I'm interested in this but only as a way of notifying a user that thier content has been voted on. I wandered onto this thread because I couldn't see how notifications hooks up with voting.
Maybe someone can point me back to a notifications/voting api solution.
If rules/voting api is my best solution then I could well be interested in chipping in to get this working.
All the best,
Mark.
#35
Hello all!
The answer to the original question is YES!
I was looking for a way to announce a vote in the heartbeat module and I found out that the userpoint contrib module "votingpoints" available at http://drupal.org/project/userpoints_contrib was implementing an integration of voting to the rules as you can see:
votingpoints:
Adds a "rules" event for the votingapi "when user votes", and points are awarded accordingly.
I haven't look at the code yet but I can assure you it does the job!
Hope this helps!
LDdB
#36
David, how does the development go?
Just let me know if you need any more use case.
#37
FYI we figured out how to emulate voting actions in v6.x here - http://drupal.org/node/592866
#38
@LDdB
Thanks for info mate. Was just looking for something similar. Going to give it a try straight away.
#39
http://drupal.org/project/userpoints_contrib generally works alright.
Unfortunately I coul not find an easy way of using the value of the vote. (Many tokens are available but non of them are related to the value.)
I will give a try to the custom token and/or php execution. Let's see...