Cannot edit a poll after 5 minutes as an administrator


(Kenny Meyer) #1

I was trying to update an old poll post as an administrator after updating to the latest version of Discourse, and I got the message “You cannot update a poll after 5 minutes, please contact a moderator”.

Can you please fix that if I am logged in as a moderator or administrator that it updates the poll, please? This is clearly a bug.

I am running on Discourse: v1.3.0.beta7 +2

Hack to get around editing a poll after 5 minutes, what are the implications?
(Stephanie) #2

I’ve also had this issue as a moderator. It also won’t let me add a poll to a non-poll post that’s over 5 minutes old, which seems like something that should be allowed without moderator approval.

(Kenny Meyer) #3

I also checked the implementation, and it seems to be broken: discourse/plugin.rb at 033761d2f629f45d8409ce7c5a547ff30ebb3543 · discourse/discourse · GitHub

The verification if the user trying to edit the poll is a moderator or admin seems to be faulty.

(Jeff Atwood) #4

I am sure @zogstrip can get it fixed up. Thanks for diagnosing.

(Régis Hanol) #5

Actually, it’s not :wink: Here’s the rule:

Polls cannot be modified/updated/renamed/changed 5 minutes after their inception.
Pass that time, we only allow staff members to fix a typo (ie. edit the content of an option).

I just pushed a fix that will hopefully improve the copy and make it clearer :hatching_chick:

(cpradio) #6

So what if a post doesn’t currently have a poll, and it is say a month old. If you edit that post, should you be able to add a poll? If so, there is still a bug (as I tried and got the “polls can’t be edited after 5 minutes error”) :smile:

(Régis Hanol) #7

Just create a new post then :wink:

(cpradio) #8

Well, ultimately, I created screenshots, as I was trying to update our “Community Cheatsheet” :smile: So yes, I got around it, just was clarifying that it really is stopping any poll changes after the ninja edit window expires (or so it seems)

(Jeff Atwood) #9