Page MenuHomePhabricator

Unable to submit drag-and-drop vote when questions shuffled
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

If you have an STV election with "Shuffle questions on the voting page" checked, if the questions have been shuffled out of the order they were in when the election was created, you cannot submit a vote. You instead see an error stating At least one option must be ranked.

As an example, the POST data when the vote fails shows the votes for the questions which are not in the right order are all 0:

securepoll_q0002713_opt0000001=0
securepoll_q0002713_opt0000002=0
securepoll_q0002713_opt0000003=0
securepoll_q0002709_opt0000001=0
securepoll_q0002709_opt0000002=0
securepoll_q0002718_opt0000000=2719
securepoll_q0002718_opt0000001=0
securepoll_q0002718_opt0000002=0
securepoll_q0002718_opt0000003=0
securepoll_q0002718_opt0000004=0

If the questions are in the order you created them, you can submit the form.

Steps to reproduce problem
  1. Create an election: select poll type STV, check "Shuffle questions on the voting page" and make at least two questions.
  2. Go to the election voting page. Refresh the page until the questions are not in the order you created them in.
  3. Attempt to vote.
Environment

Browser: Firefox 128. Safari 16.5.
Wiki(s): https://vote.wikimedia.beta.wmflabs.org SecurePoll 3.0.0 (fd684a5) 07:38, 19 May 2025.

Screenshots

The vote as it appeared before I submitted it:

shuffled_votes_before.png (697×972 px, 43 KB)

The vote after I attempted to submit, showing the error:

shuffled_votes_after.png (700×973 px, 39 KB)

Event Timeline

Amdrel changed the task status from Open to In Progress.May 29 2025, 5:59 PM
Amdrel claimed this task.
Amdrel moved this task from Backlog to Actively working on the MediaWiki-extensions-SecurePoll board.

Change #1152795 had a related patch set uploaded (by Amdrel; author: Amdrel):

[mediawiki/extensions/SecurePoll@master] Fix submission of votes from shuffled ballots

https://gerrit.wikimedia.org/r/1152795

Change #1152795 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Fix submission of votes from shuffled ballots

https://gerrit.wikimedia.org/r/1152795