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.

Comments

Zen’s picture

Version: 4.7.3 » 4.7.4
Assigned: Unassigned » Zen

The 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.

Zen’s picture

StatusFileSize
new1.82 KB

.

dww’s picture

Status: Needs review » Closed (duplicate)
dww’s picture

Status: Closed (duplicate) » Needs review

whoops, 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.

killes@www.drop.org’s picture

Does this need to be fixed in HEAD as well?

meba’s picture

Version: 4.7.4 » 5.0-beta2

Same bug as appears in 5.0 beta 2. And not only moderated polls are involved, all polls i think...

drumm’s picture

Status: Needs review » Needs work

patching 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

pearcec’s picture

The 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.

gábor hojtsy’s picture

Version: 5.0-beta2 » 5.x-dev
Assigned: Zen » gábor hojtsy
Status: Needs work » Reviewed & tested by the community
StatusFileSize
new908 bytes

The 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.

drumm’s picture

Version: 5.x-dev » 4.7.x-dev

Committed to 5.x.

4.7.x has the same code, so I am guessing this should go there.

killes@www.drop.org’s picture

Status: Reviewed & tested by the community » Fixed
pearcec@drupal.org’s picture

Version: 4.7.x-dev » 5.5
Status: Fixed » Active
StatusFileSize
new847 bytes

Not 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.

dave reid’s picture

Version: 5.5 » 4.7.11
Status: Active » Fixed

Please file a separate issue then. This issue has been fixed.

Status: Fixed » Closed (fixed)

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