Needs work
Project:
Voting Rules
Version:
7.x-1.0-alpha1
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Nov 2010 at 17:06 UTC
Updated:
4 Jan 2013 at 21:56 UTC
Jump to comment: Most recent
Comments
Comment #1
betoaveigaProbably you'll have to use some PHP condition using the voting API... I'll try this module soon, I need the same functionality, perhaps I could help soon :)
Comment #2
heydemo commentedProblem is that VotingAPI does not keep track of this info, and we're hooking into the process AFTER the vote has been inserted into the database....so this would require a change to VotingAPI Module to fix.
So there is no way for Voting Rules to know if content has been voted on before.
A possible workaround would be to set a user based flag on the content when a user votes on content i.e. 'User has voted on node', then to add a condition to check that flag.
Comment #3
Taxoman commentedIs this also an issue on D7? (then I assume it would be solved in that branch first now)
This comes quite close to being considered a "bug".
Comment #4
heydemo commentedYes, this applies to Drupal 7. I guess you could consider it a bug...the problem is that Voting API was not written from the perspective of supporting Voting Rules....and I am powerless to fix this problem since it requires changing code in Voting API module. If there is enough interest maybe I can talk to Voting API maintainers to see if we can resolve this issue.
Comment #5
Taxoman commentedHmm, surely Voting API is "here" to provide other modules with what is regarded as important functionality (its an API after all), so it would be a bit strange if the maintainer was unwilling to make such adjustments - IMHO.
If there is not a feature request for this over on that project already, we should make one now.
Comment #6
heydemo commentedOk, I've created an issue in Voting API queue
http://drupal.org/node/1269614
Comment #7
istryker commentedThe best solution would be to add an event "pre vote cast", where you can do stuff before the vote happens. Currently this is not possible.
@heydemo, IMO #1269614: Add pre-save or pre-set hook before data is store to database will not solve this problem either, as that is an in code solution, and the rule will only fire after the vote has be casted.
I believe #1880462: Keep track of the previous vote in the database patch to VotingAPI will allow you to be able to create a condition to do this.
The condition would by an if statement. It would be something like:
If the current previous vote is
NULL, then this is the first time the vote has be casted; therefore, user has NOT already voted on entity/node.Return FALSE[first time voting]Remember:
#1 - Rule runs/triggered after the vote has been casted and added/updated to the database (updated = old one delete new one added)
Comment #8
perforator commentedWhats the status of this issue? I've patched voting_rules.rules.inc but it seems I don't get the rule working. Can somebody please give step-by-step instructions for creating the rules? I've looked at the screenshot in the various issues but I didn't get it.
My usecase: Vote (thumb-up) on nodes for increasing radioactivity (module).
Thanks