Problem/Motivation
When you try to remove a poll choice by saving the poll edit form with the poll choice removed, the poll choice is not actually removed from the poll.
This is because poll_update() does not actually remove the poll choice from the database.
Proposed resolution
D7/D8
Add code to poll_update() which deletes a choice from the poll_choice table when the poll is re-submitted with the title of a specific choice is blank. Also, test coverage should be added.
D8 Patch: #13
Bug also exists on D7, backport of final accepted patch will be needed.
Remaining tasks
- #13 (D8) needs review and testing.
- Once the issue is resolved for D8, we need a D7 backport.
User interface changes
None, except poll choice removal will actually work.
API changes
None.
Original report by ntigh52
When I try to remove choices from poll its not response.
I "clean" the Choice blank and still not response.
its also in my localhost.
php 5.3.4
mysql 5.1.53
Comment | File | Size | Author |
---|---|---|---|
#14 | 1214876-test-only-should-fail.patch | 1.55 KB | brianV |
#13 | 1214876-remove-poll-choice-with-tests.patch | 2 KB | brianV |
#12 | 1214876-remove-poll-choice-with-tests-D8.patch | 2 KB | brianV |
#7 | 1214876-poll-remove-choice-7.patch | 457 bytes | Shyamala |
#4 | 1214876-poll-remove-choice-4.patch | 363 bytes | Shyamala |
Comments
Comment #1
StevenPatzComment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedI have the same issue. D7.7
Comment #3
ntigh52 CreditAttribution: ntigh52 commentedI dont know how to fix it.
But To "Solve" that issue... You can create a new poll with the same question and chioces and fill the numbers of votes...
of course until this issue will fix.
Comment #4
Shyamala CreditAttribution: Shyamala commentedWhen the choice is empty we are not deleting the choices from the poll_choice table. Attached patch should resolve the same.
Comment #5
Shyamala CreditAttribution: Shyamala commentedChanging status
Comment #7
Shyamala CreditAttribution: Shyamala commentedRepatching
Comment #8
Shyamala CreditAttribution: Shyamala commentedComment #9
brianV CreditAttribution: brianV commentedI thihnk your fix is correct, but a few comments:
1. This should be done on D8 first, then backported to D7.
2. This needs test coverage, since the current tests obviously don't pick up that the choice is never deleted..
3. Your patch has incorrect whitespacing before the beginning of the db_delete() statement.
Comment #10
webchickI think this is correct. An issue summary would be helpful, because I can't tease out an actual bug report of the OP, nor any of the comments until #9.
Comment #11
webchickOops. One more.
Comment #11.0
brianV CreditAttribution: brianV commentedUpdate the summary to an actual bug report.
Comment #12
brianV CreditAttribution: brianV commentedHere is a patch that should resolve this. Includes test coverage testing that poll choices are removed successfully.
Comment #12.0
brianV CreditAttribution: brianV commentedfix typo
Comment #13
brianV CreditAttribution: brianV commentedResubmitting without -D8 suffix so testbot will look at it. Identical to patch in #12...
Comment #13.0
brianV CreditAttribution: brianV commentedCreate proper issue summary as per webchick's request.
Comment #14
brianV CreditAttribution: brianV commentedAlso uploading the test only to show that it fails without the bug fix included.
Comment #15
marcingy CreditAttribution: marcingy commentedRan locally initally with path in #14 which failed as expected and then #13 which passed. Looks good to me.
Comment #16
marcingy CreditAttribution: marcingy commentedadding backport
Comment #18
marcingy CreditAttribution: marcingy commentedPatch in #13 is good and rtbc
Comment #19
webchickFixing tag.
Comment #20
webchickCommitted and pushed to 8.x and 7.x. Thanks!
Comment #21.0
(not verified) CreditAttribution: commentedUpdate link to latest patch.