Hi Nathan & Jeff,
I believe that when "Allow users to undo their votes" (fivestar_unvote) is checked and a user "undoes" their vote, the process of deleting the vote should be run through the VotingAPI. This allows other modules to be triggered when a Fivestar vote is undone (deleted).
Attached is a patch that contains the code changes that support this.
I look forward to your review!
Mike
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fivestarVotingapiDelete2.patch | 3.45 KB | mpaler |
| fivestarVotingapiDelete.patch | 3.42 KB | mpaler |
Comments
Comment #1
mpaler commentedDid I post this under the wrong status? Perhaps Drupal 6 has messed up the whole curve... :(
Comment #2
quicksketchThat's a really good point. I'm not sure why we're not using votingapi_delete_vote in Drupal 5 (we are in Drupal 6 though). Jeff wrote the original Voting API implementation for Fivestar, so I'm guessing it's something to do with the support for anonymous votes (which isn't supported in Drupal 5 AFAIK). I'll ping Jeff and see if he has additional input on this issue.
In the mean time, could you format your patch according to the Drupal coding standards? There's a few problems like using tabs instead of spaces, spaces at the end of line numbers, and putting
} else {all on one line. See http://drupal.org/coding-standards.Comment #3
xenostar commentedThis is a test of the emergency broadcast system.
Comment #4
mpaler commentedNot sure what xenostar is testing....however, attached is a (hopefully) correct patch.
Please let me know if it still needs work.
Thanks,
Michael
Comment #6
kmillecam commentedBump.
This is actually a critical patch for users of User Points.
I just had a user report that he could vote (and earn points), then delete his vote and vote again (to earn more points).
Not a good scenario (unless you're trying to scam the system).
+1 for incorporating this patch into the API.
Thanks,
Kevin
Comment #7
quicksketchI couldn't find any problems with this approach in my testing, plus it seems like it's something that's a good idea anyway. I cleaned up the patch a bit (still a few whitespace issues) and committed. Thanks!
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.