# Anonymous votes in poll plugin

**URL:** https://meta.discourse.org/t/anonymous-votes-in-poll-plugin/42382
**Category:** Development
**Tags:** polls
**Created:** [April 11, 2016, 10:05am UTC](https://meta.discourse.org/t/anonymous-votes-in-poll-plugin/42382 "2016-04-11T10:05:10Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [April 11, 2016, 10:05am UTC](https://meta.discourse.org/t/anonymous-votes-in-poll-plugin/42382/1 "2016-04-11T10:05:10Z")

</div>

I’m in the process of fixing the import of polls in the phpBB3 importer. I noticed a few days ago that it was completely broken since October. 😊

Anyway, in phpBB3 it is possible for anonymous users to vote in polls. Up until October I set the `voters` attribute of the poll and `votes` of each option manually, so I didn’t lose the original poll result. This isn’t possible anymore since the current version of the poll plugin recalculates all counts on each vote.

I was thinking about adding an `anonymous_voters` attribute to the custom field `polls` and save the count of anonymous votes for each option in the `polls-votes` field. These optional values could be used on every recalculation of the poll result if they exist. I have no intention to expose the anonymous vote feature to the user. It would be an internal thing, mostly in order to not lose votes during imports.

@zogstrip Would you accept a PR for that? Or should I discard anonymous votes and warn users during the import that they are going to lose data?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 11, 2016, 5:07pm UTC](https://meta.discourse.org/t/anonymous-votes-in-poll-plugin/42382/2 "2016-04-11T17:07:21Z")

</div>

> [@gerhard](#):
>
> @zogstrip Would you accept a PR for that?

I definitely would 😉

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [March 13, 2017, 4:51pm UTC](https://meta.discourse.org/t/anonymous-votes-in-poll-plugin/42382/3 "2017-03-13T16:51:05Z")

</div>

can anonymous users vote in a poll now? I mean users that are not login to site.

the topic is quite old! sorry to bring it p, I couldn’t find any other related topic with 10 min search.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 13, 2017, 4:57pm UTC](https://meta.discourse.org/t/anonymous-votes-in-poll-plugin/42382/4 "2017-03-13T16:57:56Z")

</div>

No, anon users can’t do anything in Discourse.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [October 16, 2018, 3:16am UTC](https://meta.discourse.org/t/anonymous-votes-in-poll-plugin/42382/5 "2018-10-16T03:16:52Z")

</div>

@zogstrip I’m using the `anonymous_votes` property to implement a feature for a client that allows you to set a base number of votes for each option in a poll.

As this is a ‘hidden feature’ of sorts, I’m slightly worried its behaviour may be changed down the line. If you could give me a heads up if you’re planning to remove or change the `anonymous_votes` or `anonymous_voters` properties that would be awesome. Thanks 🙂

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [October 16, 2018, 9:07am UTC](https://meta.discourse.org/t/anonymous-votes-in-poll-plugin/42382/6 "2018-10-16T09:07:31Z")

</div>

> [@angus](#):
>
> As this is a ‘hidden feature’ of sorts, I’m slightly worried its behaviour may be changed down the line. If you could give me a heads up if you’re planning to remove or change the `anonymous_votes` or `anonymous_voters` properties that would be awesome.

I actually reaped it in [REFACTOR: use tables instead of custom fields for polls by ZogStriP · Pull Request #6359 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/6359) since I couldn’t see any use of that hidden feature and completely forgot about this topic.

But I’ll add it back before I get it merged.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [October 16, 2018, 11:05am UTC](https://meta.discourse.org/t/anonymous-votes-in-poll-plugin/42382/8 "2018-10-16T11:05:36Z")

</div>

Thanks! Phew, glad I mentioned it 🙂

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [November 19, 2018, 1:51pm UTC](https://meta.discourse.org/t/anonymous-votes-in-poll-plugin/42382/9 "2018-11-19T13:51:24Z")

</div>

[https://github.com/discourse/discourse/commit/4459665deeb84fb43621be90d64378ebc5fbd365](https://github.com/discourse/discourse/commit/4459665deeb84fb43621be90d64378ebc5fbd365)

Has been merged with support for anonymous votes 👌
