Closed (fixed)
Project:
Drupal core
Version:
4.7.11
Component:
poll.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
14 Oct 2006 at 16:56 UTC
Updated:
28 Mar 2009 at 20:20 UTC
Jump to comment: Most recent file
A poll is created by a user and is awaiting moderation then an admin edits it to publish it, she/he finds that all choices are removed. I fixed this bug and the patch is attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | poll.module-create-polls-edit-votes.patch | 847 bytes | pearcec@drupal.org |
| #9 | poll-non-admin-submit-fix.patch | 908 bytes | gábor hojtsy |
| #2 | patch1.txt | 1.82 KB | Zen |
| amardini-poll-module-20061014.patch | 560 bytes | amardini |
Comments
Comment #1
Zen commentedThe provided patch won't fix existing polls that have incorrect chorder values. Please review the attached patch and RTBC if all OK :)
Cheers,
-K
P.S Please always add a period after your code comments.
Comment #2
Zen commented.
Comment #3
dwwhttp://drupal.org/node/67895
Comment #4
dwwwhoops, sorry, i spoke too soon. ;) i guess this issue is about the *options* getting cleared in this case. the other issue is about the *votes* getting cleared. sorry.
Comment #5
killes@www.drop.org commentedDoes this need to be fixed in HEAD as well?
Comment #6
meba commentedSame bug as appears in 5.0 beta 2. And not only moderated polls are involved, all polls i think...
Comment #7
drummpatching file poll.module
Hunk #1 FAILED at 144.
Hunk #2 succeeded at 217 (offset 42 lines).
1 out of 2 hunks FAILED -- saving rejects to file poll.module.rej
Comment #8
pearcec commentedThe original patch is definitely a problem that needs to be solved.
The second patch tries to address this problem:
http://drupal.org/node/67895
The problem described in 67895 is that some users might have the ability to make a revision edit, but the form does not populate the votes. Therefore it deletes the votes. So I think patch1,txt is a red herring.
While neither of these fixes address the actual problem of revisioning the poll, I will take 67895 at this point.
Comment #9
gábor hojtsyThe second patch does not apply then, as the other issue was solved in Drupal 6. I also seen that the $i=0 initialization code is in Drupal 6, and was solved by merlinofchaos in http://drupal.org/node/162871 Seem like that needs to be committed to D5.
The bug there is that $i is used before, when a non-administrator submits a poll. But then not initialized to 0 again, when reused, so $i runs forward, and the poll option counts become higher then intended. As said, already fixed in Drupal 6. Attached patch rerolled against Drupal 5.
Comment #10
drummCommitted to 5.x.
4.7.x has the same code, so I am guessing this should go there.
Comment #11
killes@www.drop.org commentedComment #12
pearcec@drupal.org commentedNot sure where to post this but there seems to be a case where non-admin's form does not allow editing the number of votes cast. Therefore they are lost during the update. So either we allow people in a role with the permission to "create polls" to change votes when editing or we have to load the previous votes. I am going to let anyone who can "create a poll", edit the votes.
Is anyone else experiencing this issue?
Edit: Added a patch for those who care.
Comment #13
dave reidPlease file a separate issue then. This issue has been fixed.