As a result of the discussion on the future of pollfield issue (see comments 18, 20-22) of anonymous voting irregularities, I decided to do some testing. I turned up at least one concrete problem. To illustrate it, I set up a public site that folks can check out and try voting on.

For all of these tests, the anonymous visitor has the permission to see poll results.

Anonymous voting with IP address policy works

When you vote on a poll where anonymous voting is allowed, but limited by IP address everything seems to work as expected. Here's my example:
http://pollfield.bryankennedy.org/6.x-1.10-beta1/node/1
You can vote the first time, then you see the results and are not offered the opportunity to vote again, but can cancel your vote and vote again. Great!

Anonymous voting with cookie policy only sort of works

When you vote on a poll where anonymous voting is allowed, but limited by a cookie, you are still properly blocked from voting multiple times, but not in the way that your visitors probably expect. See this example:
http://pollfield.bryankennedy.org/6.x-1.10-beta1/node/2
When you first visit the poll you can vote and it is recorded. However, after that you are just sent back to a voting form. When you try and vote again, you get the message You already voted or your are not allowed to vote.
So the 2nd vote is getting blocked, but you don't get to see the results and your visitor probably thinks that something has gone wrong.

Please visit my test site and see if you get the same behavior. I am happy to keep this site up for testing the latest versions of dev pollfield.

CommentFileSizeAuthor
#4 pollfield.module.patch505 bytesbryan kennedy

Comments

mario_prkos’s picture

It is great, Bryan !!!

First test shows that was good idea because I did not able to produce this results on my local host installation. So we have to investigate.
1. question:
Can you find this id1257469003 in field cookie in table pollfield_votes ; That is my vote.
You have to have something like: a:2:{s:11:"cookie_name";s:25:"opinion_poll_field_voter_0";s:12:"cookie_value";s:12:"id1257469003";}
I think you probably have so votes are saved but when form is render it not recognized vote.
Try put print_r($field_table." ".$field_name." ".$field_name_delta." ".$node->nid); on line 560 so that we can see what function
is looking.

bryan kennedy’s picture

Issue tags: -CCK, -anonymous users, -voting

Mario, I will look into that cookie this evening. I just now updated the issue with a new URL to my test site.

mario_prkos’s picture

Yeah, test site now is working. It behave like suppose to behave. Can you please tell what did you change from last time?
It will be very useful to put this problem and solution you find to some kind of troubleshoot board.

Thanks again bryan for your good work.

bryan kennedy’s picture

Title: Irregular behavior in anonymous voting » Irregular behavior in anonymous voting with cookies
Assigned: Unassigned » bryan kennedy
Status: Active » Needs review
Issue tags: +CCK, +anonymous users, +voting
StatusFileSize
new505 bytes

OK, I found out that the cookies were being generated in the browser, and also stored in the database. However, the cookie was getting generated in the browser using the default path settings for the php setcookie() function. This put the path of the cookie as the site's URL + the URL of the pollfield directory. As a result the cookie wasn't loading in the browser.

To fix this I added the path argument to the setcookie() function to the root directory which is how other cookies are handled in Drupal core. Here's a patch for this minor fix. It works on the test site listed above now.

mario_prkos’s picture

Title: Irregular behavior in anonymous voting with cookies » Irregular behavior in anonymous voting
Assigned: bryan kennedy » Unassigned
Status: Needs review » Active
Issue tags: -CCK, -anonymous users, -voting

Maybe we should consider this page as demo and test page for this module. What you think to open discussion group about pollfield so we can shares ideas and thoughts and use issues tracks for problems and bugs.

bryan kennedy’s picture

Status: Active » Needs review
bryan kennedy’s picture

I am happy to keep my site up for testing the pollfield module in public. Mario, we should probably talk off line about making sure we keep it up to date. Feel free to contact me via my user profile.

A group over at groups.drupal.org also sounds like a good idea. I'd like to make sure that we keep any bug reports and issues here in the issue tracker since that's what it's designed for. Right? Mario, do you want me to put in an application for that?

mario_prkos’s picture

I will announce this patch on front and put it in dev version. I am very happy how this is going and so much good work is done.

Basically idea was that brainstorming is done on group so we can keep track ideas on one place but issues, bugs, problems maybe features requests in issue tracker. This is good so I can easy keep track of users needs and ideas questions etc. I like when is something fixed I just closed and moved on and sometime there is good stuff in that thread I hate to lose. Just I would like to separate those two things. Other things what is in my mind about group is that sometimes I have dilema or trilema about some features and I want to know your opinion and experience as drupal users (developers). Some of you are much longer in drupal then I and I want to use your knowledge as much as I can to deliver best what community can give.
So if it does make you sense to you we can proceed.
About test site-demo site I will contact you via user profile. And we can agree how we will proceed.

Mario

bryan kennedy’s picture

Yeah I totally agree Mario.

The issue tracker is good for checking things off your list, but we do lose some of the discussion about functionality and approach when the issues close.

I hope I didn't jump the gun, but I went ahead and submitted an application for a Pollfield group. I'll message you when it's accepted and I can make you a manager. Once it's approved, you can announce it and we can start working out the mission statement and such over there.

mario_prkos’s picture

Great, Bryan. It will be excellent place to collaborate and share ideas.

burningdog’s picture

Status: Needs review » Reviewed & tested by the community

Bryan, this is exactly the problem I had too when using cookies to track voting by anonymous users. The anonymous user could vote, the vote was recorded, but didn't show up for that user (as my admin user I could see the vote). Plus it would seem that I could vote again as the anonymous user, but when submitting the vote I got the error "You already voted or your are not allowed to vote".

Your patch fixes this. I can vote as an anonymous user and pollfield can see I've voted, so it doesn't give me the option to vote again. Thanks :)

mario_prkos’s picture

Status: Reviewed & tested by the community » Fixed

fixed published on fornt page

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Updating the URLs because of a change on my site.