Download & Extend

Anonymous Window does not take Immediately into consideration

Project:Voting API
Version:6.x-2.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I could not get the anonymous window to work properly with the Plus 1 module. Looking into the code a little deeper I noticed that the Plus1 Module calls "votingapi_select_votes" to determine if the current 'user' has casted any votes. In "votingapi_select_votes", the logic to incorporate votingapi_anonymous_window is:

if (!empty($criteria['vote_source']) && $anon_window > 0) {

However, $anon_window = 0 when it is set to "immediately". I propose this line of code be changed to:

if (!empty($criteria['vote_source']) && $anon_window >= 0) {

Comments

#1

Status:active» needs review

I had the same problem while using the Decisions module, and came to the same conclusion:
If the window is set to 0, criteria['timestamp'] is not set, resulting too many votes being returned.
Attached patch (with the same modification as above) works for me.

AttachmentSize
anon_immediate.patch 503 bytes

#2

Same for me. The above fix works for me also.

#3

Status:needs review» fixed

Applied to the D7 branch, will be backported to D6. Thanks!

#4

Status:fixed» closed (fixed)

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

nobody click here