# Cannot edit post with poll

**URL:** https://meta.discourse.org/t/cannot-edit-post-with-poll/172321
**Category:** Support
**Created:** [December 5, 2020, 10:33am UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321 "2020-12-05T10:33:48Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Atalanta](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@Atalanta](https://meta.discourse.org/u/Atalanta)
#### Post date: [December 5, 2020, 10:33am UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/1 "2020-12-05T10:33:48Z")

</div>

I believe I have the same issues as in this post, but unfortunately it’s closed.

> [@Cannot edit post with a poll](https://meta.discourse.org/t/cannot-edit-post-with-a-poll/103753):
>
> Both moderators and staff on our forum cannot edit a post that contains a poll that was created several days ago - we always get the following error: ‘You cannot change a poll after the first 5 minutes’. We’re on the latest build. Might be a regression of this issue?

I have been trying to change some text in this post (and another one which I cannot link to due to new user restrictions), but I get the same error (“You cannot change a poll after the first 5 minutes.”). Please note that I am not editing the poll at all; all I am trying to do is turn some text in the Schedule section of these posts into a link. It doesn’t matter whether the poll is open or closed.

> **[ドラゴンボールSD (Dragon Ball SD) Home Thread 🐉](https://community.wanikani.com/t/%E3%83%89%E3%83%A9%E3%82%B4%E3%83%B3%E3%83%9C%E3%83%BC%E3%83%ABsd-dragon-ball-sd-home-thread-%F0%9F%90%89/45781)**
>
> Welcome to ドラゴンボールSD! Currently reading: Volume 12 Discussion Volume 1 Volume 2 Volume 3 Volume 4 Volume 5 Volume 6 Volume 7 Volume 8 Volume 9 Volume 10 Volume 11 Volume 12 Vocabulary list Please read the guidelines on the first...

---

<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: [December 10, 2020, 2:16am UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/2 "2020-12-10T02:16:16Z")

</div>

Can we repro this @tshenry?

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [December 10, 2020, 2:38am UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/3 "2020-12-10T02:38:44Z")

</div>

By the way, while this has happened to several users on [http://community.wanikani.com](http://community.wanikani.com) recently, other users have been able to edit posts with polls just fine. Is it possible there was a recent bug that has already been resolved, but posts created when the bug existed are stuck in a bad state?

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [December 10, 2020, 3:05am UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/4 "2020-12-10T03:05:28Z")

</div>

Hmm, I am not able to repro.

I copied the exact markdown from the linked post in the OP to be extra thorough just in case there was some oddly specific edge case. I waited for the 5 minute edit window to expire and tried adding a link to an entry in the Schedule section. It saved without issue.

> [@seanblue](#):
>
> Is it possible there was a recent bug that has already been resolved, but posts created when the bug existed are stuck in a bad state?

I guess it’s possible, but I suspect not. You could try to have an admin/mod rebake the post using the “Rebuild HTML” option in the post admin menu to make sure the post is cooked to with all the latest.

I do see a strange diff in the most recent revision history:

 ![Screen Shot 2020-12-09 at 6.56.20 PM](https://global.discourse-cdn.com/meta/original/3X/7/d/7da5bfc970aa02cf08245c262e84c7dd791c7e5f.png)

It gives the impression there was a change, yet when I look at the raw diff, I see no changes.

The only thing I can think of is there is some weird edge case that can happen when an emoji is used with a poll, but so far I’m not able to prove that out.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [December 10, 2020, 3:26am UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/5 "2020-12-10T03:26:01Z")

</div>

> [@tshenry](#):
>
> It gives the impression there was a change, yet when I look at the raw diff, I see no changes.

Hmm, maybe when the user is making unrelated edits to the post there’s some automatic Discourse change in the poll area that makes it look like a change is being made to the poll itself. Could that happen if some aspect of the Discourse rendering code changed such that it generates different HTML in the poll area now compared to when the post was first made?

> [@tshenry](#):
>
> You could try to have an admin/mod rebake the post using the “Rebuild HTML” option in the post admin menu to make sure the post is cooked to with all the latest.

Just to double check before I recommend they try this, this won’t reset the poll results like when you edit a poll within the grace period, right?

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [December 10, 2020, 3:50am UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/6 "2020-12-10T03:50:34Z")

</div>

> [@seanblue](#):
>
> Just to double check before I recommend they try this, this won’t reset the poll results like when you edit a poll within the grace period, right?

No, the results are stored in the database and won’t be affected, but given my experience, I don’t think you need to bother. See below.

> [@seanblue](#):
>
> Could that happen if some aspect of the Discourse rendering code changed such that it generates different HTML in the poll area now compared to when the post was first made?

You’re on to something! If you inspect the HTML of the diff there is a change in the `data-poll-option-id` of the first option:

 ![Screen Shot 2020-12-09 at 7.31.14 PM](https://global.discourse-cdn.com/meta/original/3X/d/6/d6b19ef557503fd4e391eeebb7df00bd3967a27e.png)

 ![Screen Shot 2020-12-09 at 7.30.20 PM](https://global.discourse-cdn.com/meta/original/3X/c/c/cc18f6494fe72f593b10dec83c8764cccf19c775.png)

That’s all generated behind the scenes, so maybe there is, or was a bug somewhere that caused this to change.

I tried manually changing the `data-poll-option-id` (stored as `digest` in PollOption records) and can repro the issue (I’m no longer able to save an edit). If I change it back to its previous value, I can edit normally.

Let me check on a couple more things.

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [December 14, 2020, 9:13pm UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/12 "2020-12-14T21:13:06Z")

</div>

Ok, I have a follow-up on this. I checked with engineering and they narrowed it down to the emoji used in the poll. Its image source ended up changing in the cooked post value which put things into a bit of an odd state. The emoji source shouldn’t be changing very often, if at all, so I think it’s very unlikely this will be an ongoing problem. Unfortunately, given the rarity and the amount of effort it would take to fix existing occurrences, I’m afraid that post will need to be recreated or left as is.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [December 15, 2020, 1:08am UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/14 "2020-12-15T01:08:42Z")

</div>

Okay, that makes sense. Thanks for following up. I’ll let the other users know that they can ask the staff to rebake the posts to (possibly) fix the issue, but that there will not be an automatic fix made.

---

<div class="post-metadata">

### Author: ![Atalanta](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@Atalanta](https://meta.discourse.org/u/Atalanta)
#### Post date: [December 15, 2020, 11:50am UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/15 "2020-12-15T11:50:14Z")

</div>

And I guess it would be best to stop using emoji in polls?

---

<div class="post-metadata">

### Author: ![Atalanta](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@Atalanta](https://meta.discourse.org/u/Atalanta)
#### Post date: [December 15, 2020, 3:50pm UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/16 "2020-12-15T15:50:19Z")

</div>

Unfortunately it seems that the ‘rebuild HTML’ option doesn’t work:

> **[ドラゴンボールSD (Dragon Ball SD) Home Thread 🐉](https://community.wanikani.com/t/%E3%83%89%E3%83%A9%E3%82%B4%E3%83%B3%E3%83%9C%E3%83%BC%E3%83%ABsd-dragon-ball-sd-home-thread-%F0%9F%90%89/45781/26?u=phryne)**
>
> Thanks to @seanblue for the information, though it looks like the ‘Rebuild HTML’ function can’t resolve the issue as well unfortunately. I’ve tried this with a separate thread by Radish as well as see if converting the post into a wiki would help,...

I have since removed the polls entirely.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 1, 2025, 11:47pm UTC](https://meta.discourse.org/t/cannot-edit-post-with-poll/172321/17 "2025-04-01T23:47:42Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
