Probably a bug introduced by the new id code. I haven't looked into it closer.

CommentFileSizeAuthor
#2 advpoll_delete_choice.patch1.53 KBChrisKennedy

Comments

ChrisKennedy’s picture

Assigned: Unassigned » ChrisKennedy

Yep, I should have realized that. The old code just deleted all choices every time the poll was updated, and re-inserted the choices that were defined in the form. Now we need to check if the choice has been removed and manually delete it - but we can also clean up the votes table too. I'll write up a patch.

ChrisKennedy’s picture

Status: Active » Needs review
StatusFileSize
new1.53 KB

Here's the ol' patch.

anders.fajerson’s picture

Nice!

I found two bugs while playing with this, don't think they are related though, so feel free to commit this and I'll create new issues when this is committed.

1. Create a poll with two choices. Edit it, erase the two choices and add two new below. Then the "You must fill in at least two choices" error is fired.

2. Somewhere we lost the possibility to dynamically remove all choices. If the are all removed you get a JS error if you try to add a new choice.

ChrisKennedy’s picture

Status: Needs review » Fixed
ChrisKennedy’s picture

Good call on the extra commit, but you should note it in the issue too. http://drupal.org/cvs?commit=90703

anders.fajerson’s picture

True. Won't happen again ;)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.