phacility/phabricator · error · Exception
In this poll, you may only vote for one option.
Error message
In this poll, you may only vote for one option.
What it means
PhabricatorSlowvoteVoteController throws this when a submitted ballot contains more than one selected option on a plurality (single-choice) poll ($is_plurality with count($votes) > 1). The stock UI renders radio inputs for such polls, so hitting this means a modified/hand-crafted POST, a custom client, a browser extension duplicating form fields, or a customized template rendering checkboxes for every poll.
Source
Thrown at src/applications/slowvote/controller/PhabricatorSlowvoteVoteController.php:54
$method = $poll->getMethod();
$is_plurality = ($method == SlowvotePollVotingMethod::METHOD_PLURALITY);
if (!$votes) {
if ($is_plurality) {
$message = pht('You must vote for something.');
} else {
$message = pht('You must vote for at least one option.');
}
return $this->newDialog()
->setTitle(pht('Stand For Something'))
->appendParagraph($message)
->addCancelButton($poll->getURI());
}
if ($is_plurality && count($votes) > 1) {
throw new Exception(
pht('In this poll, you may only vote for one option.'));
}
foreach ($votes as $vote) {
if (!isset($options[$vote])) {
throw new Exception(
pht(
'Option ("%s") is not a valid poll option. You may only '.
'vote for valid options.',
$vote));
}
}
$poll->openTransaction();
$poll->beginReadLocking();
$poll->reload();
View on GitHub (pinned to 5720a38cfe)
Solutions
- Submit exactly one option ID for plurality polls
- If you customized poll templates, render single-choice inputs (radio behavior) for plurality polls and multi-select only for approval polls
- If this fires from normal UI use, check for browser extensions or scripts duplicating the votes[] fields
Example fix
# before: multiple selections on a single-choice poll curl -b cookies -d "votes[]=101&votes[]=102" https://phab.example.com/V1/vote/ # after: one selection curl -b cookies -d "votes[]=102" https://phab.example.com/V1/vote/
Defensive patterns
Strategy: validation
Validate before calling
// Client-side, before POSTing a ballot
if (poll.isPlurality && selectedOptionIds.length > 1) {
// block submit: single-choice polls accept exactly one option
} Prevention
- Render radio-style single selection for plurality polls; multi-select only for approval polls
- Validate the selection count against the poll method before POST
- Keep form markup free of duplicated votes[] fields; test with browser extensions disabled
When it happens
Trigger: POSTing to a poll's vote endpoint (e.g. /V<id>/vote/) with two or more values in the votes[] fields on a poll configured for a single choice. Note empty ballots are handled earlier by a dialog; this check runs before per-option validation.
Common situations: Automated voting scripts; replayed/edited form submissions; template customizations that render checkboxes regardless of poll method; duplicated form fields from extensions or markup changes.
Related errors
- Request includes restricted parameter "%s", but this control
- Unrecognized verb: %s
- Invalid revision ID "%s".
- Failed to decode rule data.
- Too many relationships (%s, of type "%s").
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/506ba765ed20badc.
Report an issue: GitHub.