Cannot edit a poll after 5 minutes as an administrator

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

3 Likes

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.

I also checked the implementation, and it seems to be broken: https://github.com/discourse/discourse/blob/033761d2f629f45d8409ce7c5a547ff30ebb3543/plugins/poll/plugin.rb#L272

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

1 Like

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

2 Likes

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:

https://github.com/discourse/discourse/commit/c1bb7bc7cc54059073b1dccc83a707936ca16b67

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:

1 Like

Just create a new post then :wink:

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)

2 Likes