Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: mint on February 21, 2012, 06:38:19 PM

Title: [4971] Edit poll reverts to "Show the poll's results to anyone."
Post by: mint on February 21, 2012, 06:38:19 PM
When you edit a previously created poll the privacy settings for who can see the results defaults to "Show the poll's results to anyone." regardless of the original setting.
Title: Re: Edit poll reverts to "Show the poll's results to anyone."
Post by: emanuele on February 21, 2012, 06:59:11 PM
Version of SMF?
Mods installed?
What do you change when you see such behaviour?

I tried to replicate it in SMF 2, but I didn't succeeded.
Title: Re: Edit poll reverts to "Show the poll's results to anyone."
Post by: mint on February 21, 2012, 07:15:21 PM
My bad. Just upgraded from 2.0.1 to 2.0.2 and it appears to have been fixed  :-[
Title: Re: Edit poll reverts to "Show the poll's results to anyone."
Post by: mint on March 18, 2012, 07:00:01 PM
I'd like to re-open this bug report as it's just happened again. I have set up a fresh install of 2.0.2 with no mods installed to test the bug. Heres how it occurs.

Create a new default registered user.

Log in as the new user and create a poll with a set voting length and click the third radio button to not allow users to see the results until the poll has ended.

post the poll

edit the poll

The third radio button is still the default option. it's also greyed out but this is easily missed.

Once the poll is edited all users are now able to see poll results! clicking edit again now sees button 1 as the default option but the third radio button is stilled greyed.

The administrator can change the options but the OP cannot.

Cheers,
John
Title: Re: Edit poll reverts to "Show the poll's results to anyone."
Post by: emanuele on March 19, 2012, 05:24:43 AM
Ok, last bit of details to reproduce the bug: you must be a non-admin and non-moderator (editing your own poll).

Confirmed in 2.0.2.
The problem is in the way $context['can_moderate_poll'] is set: it takes into account only the permission and the "adding" a new poll to a topic:
$context['can_moderate_poll'] = isset($_REQUEST['add']) ? 1 : allowedTo('moderate_board');