Hello,
Anonymous vote rollover is not working except if it is set to "never".
If i set it to "1 day" anonymous users can vote as many times as they want.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | 997092-20.votingapi-anonymous-votes.patch | 1007 bytes | ksenzee |
| #10 | votingapi-997092-10.patch | 1.07 KB | zambrey |
| #9 | votingapi-997092-2.patch | 626 bytes | ericduran |
| #6 | votingapi-997092.patch | 559 bytes | ericduran |
| #3 | votingapi-997092-3.patch | 1.47 KB | paranojik |
Comments
Comment #1
mauritsl commentedI got the same issue when testing the Rate module for D7 (7.x-dev snapshot will be available within hours).
Just create a new widget (doesn't matter which type you choose), activate it on a nodetype and logout. You can vote as many times as you like. Expected result was that you changed your vote (like the D6 version does).
Comment #2
mauritsl commentedProblem seems to be that votingapi_select_votes() is not handling the timestamp criteria well. It only selects votes from that exact timestamp, instead of all votes from after that time. Patch attached fixed this issue for me.
Also note that the default value for this variable is not the same as on the settings page:
votingapi.module line 317:
$anon_window = variable_get('votingapi_anonymous_window', 3600);
votingapi.admin.inc line 19:
'#default_value' => variable_get('votingapi_anonymous_window', 86400),
This is also true for 6.x.
Comment #3
paranojik commentedI can confirm the patch from #2 works. Without this fix, votingapi does not work as documented.
The attached patch also included the fix for the default value of 'votingapi_anonymous_window' to match the value from the settings page.
Comment #4
piferrari commentedthank you for this patch.
It works very well.
Comment #5
ambient.impactThanks for the patch.
Subscribing.
Comment #6
ericduran commentedI'm attaching a different patch.
Fixing the same problem, but this patch doesn't change the votingapi_anonymous_window and also remove the unnecessary is_array check.
Comment #7
zambrey commentedI cannot apply this patch to 7.x-2.x branch. I'm new to git so can you please tell me how can I use this patch?
I did following commands in Git Bash:
I have this patch in root directory of votingapi module and here is my output:
Comment #8
ericduran commentedThe above patch was made from using the git diff --relative from my local checkout. I'll make a patch using the actual git.drupal.org repo and see if that fixes any problem.
Comment #9
ericduran commentedYeah, my votingapi version was out of date.
here's a second attempt.
Comment #10
zambrey commentedThanks, now patch apply but it doesn't fix the problem.
I think change should be done in votingapi_votingapi_storage_select_votes() function rather than votingapi_select_results().
This one fixes the problem for me.
Comment #11
globexplorer commentedthis patch worked fine for me. I hope that this issue will be fixed soon.
Comment #12
Taxoman commentedAnybody else that can confirm that the latest patch is working?
Comment #13
jg314 commentedI tried to apply the latest patch and it failed to automatically patch. I was able to apply the patch from http://drupal.org/node/997092#comment-3940040 and it seems to be working. Does anyone know what the issue is with the latest patch?
Comment #14
zambrey commentedLatest patch is against 7.x-2.x-dev branch. Which version are you trying to patch?
Comment #15
jg314 commentedI am trying to patch 7.x-2.4. Should I download the dev release? Is that stable?
Comment #16
zambrey commentedWell, I haven't got any problems so far with dev release.
Comment #17
jg314 commentedWill the initial patch still work correctly on version 7.x-2.4?
Comment #18
zambrey commentedPatch looks good and it was approved by couple of people here. So it's your call since I don't know other issues that have been fixed in dev release.
Comment #19
sea4 commentedthe patch in #10 seems to be working so far. using the latest dev.
Comment #20
ksenzeeFor those who don't want to move to the dev release, here's a rerolled version of #3 that applies cleanly to 7.x-2.4. The reroll fixes some whitespace and applies using patch -p1 or git apply. Drupal Gardens will likely be running this patch until the next release of Voting API.
Comment #21
nguyentran commentedThanks, this working for me.
Comment #22
baby.hack commentedI'll confirm that #20 worked for me to fix the issue, although I didn't git apply. I just read the patch and made the listed changes manually.
Comment #23
brycesenz commentedconfirming that the post in #20 works for me.
Comment #24
Taxoman commentedSo how about committing this to the -dev branch?
Dev. hasnt been updated since April...
Comment #25
Juan C commentedIt works. Thanks for the patch.
Comment #26
franzkewd commentedComment #27
sa3er commentedThis is a cirtical/security bug that could cause some kind of flood attack :)) if configured improperly and I don't know what are you dev guys are waiting for.
Thanks for the patch #20
It works great.
Comment #28
fenstratThe patch at #20 works well.
Would love to see a 2.5 release with this included.
Comment #29
ryan.ryan commentedPatch apploed - worked for me - time to roll out me thinks.
Comment #30
blogook commentedcan someone pls upload a patched file #20 inhere? I have no clue how to patch this?
thanks in advance,
W/
Comment #31
blogook commentedno worries, problem solved
Comment #32
andypostThis tested near year for now, could someone ping maintainers to commit this?
#20 @ksenzee++
Comment #33
mauritsl commentedI already mailed the maintainer some time ago.. Still on it.
Comment #34
eaton commentedCommitted with modifications, at long last. Sorry for the delay on this one. WIll be in the 2.5 release that I'm rolling up shortly.
Comment #35
andypostCommit is totally wrong (diff) - there's no assignment now
Comment #36
eaton commentedLet this be a lesson to you: "when you're doped up on prescription cold medicine but haven't fallen asleep yet" is rarely the right time to commit a bunch of patches. Proper patch committed now; thanks for the quick heads up.