There's an issue in the radioactivity module - #739980: VotingAPI resets votes but adds unlimited energy when a user votes multiple times - that I think needs to be solved by the votingAPI widgets.

If someone has already voted (either up or down) then this module should prevent them from voting again.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marvil07’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
Category: bug » feature
Priority: Normal » Major
Status: Active » Needs work
Issue tags: +interoperability
FileSize
1009 bytes

Sounds reasonable, we need to change the widget templates to add this patch two new variables.

BTW please note that this would not prevent the user to vote up, then vote down, then vote up, etc.

marvil07’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev
Category: feature » bug
Priority: Major » Normal

upps.. too much metadata tweaking :-p

marvil07’s picture

updated patch with changed widgets, but still missing the upanddown widget

oranjer’s picture

subscribed

marvil07’s picture

Category: bug » feature

@greggles: it would be great to know your opinion about the last patch. I will complete this if you are ok with it for 2.x, in other way I will just move it to 3.x

greggles’s picture

Thanks for the ping, marvil07. I think this looks acceptable but a more thorough approach would also check in the callback whether or not the user should be allowed to do this.

marvil07’s picture

The voting ajax callback(that is the only place from where vud_vote() is call) is passed through hook_menu(), where use vote up/down permission is checked.

So if I am not missing something this is the check you are asking for(if not, it would be great if you can elaborate about why it should be checked again on vud_vote() or maybe where would be a better place for that check).

marvil07’s picture

@greggles: I think I get what you mean: you are referring to vote in the same direction check. I see one one problem, but in order to do explode it you need to manually generate the link, that includes a token, but yes, actually is possible(but not too easy for a noob :-p) to generate the link from code, and naturally you need to have the vote permission.

I will try to add a check on vud_vote() for that ;-) (so one more query per vote casting)

greggles’s picture

Thanks, marvil07. Maybe it's not worth it since they would need to figure out the token but if, for example, they look at the URL before voting, use it to vote, and use it again and again it would let them vote up many times until their session changes.

marvil07’s picture

Assigned: Unassigned » marvil07
Status: Needs work » Fixed
FileSize
10.63 KB

Finally I got this finished :-), thanks for the feedback!

I committed this patch to 3.x and 2.x.

Status: Fixed » Closed (fixed)
Issue tags: -interoperability

Automatically closed -- issue fixed for 2 weeks with no activity.