Skip to content

[3.0] Record poll votes without poll edit permission - #9902

Open
mattago93 wants to merge 1 commit into
SimpleMachines:release-3.0from
mattago93:fix-9590-poll-votes-without-edit-permission
Open

mattago93 wants to merge 1 commit into
SimpleMachines:release-3.0from
mattago93:fix-9590-poll-votes-without-edit-permission

Conversation

@mattago93

Copy link
Copy Markdown

Fixes an issue where users with permission to vote in a poll could be denied because recording their vote called Poll::save(), which requires permission to edit the poll itself.

The voting action now updates choice vote totals directly, using atomic SQL increments and decrements without requiring poll editing privileges.

The change also persists the guest voter count when guests vote.

Verification:

  • Six isolated PHP behavioral checks passed.
  • Confirmed that the original permission-dependent behavior fails the guest voting scenario.
  • Full SMF integration tests have not been run.

Issues References (Fixes|Related|Closes)

Fixes #9590

Persist vote totals directly instead of calling Poll::save(), which
requires poll editing privileges. Keep guest voter totals in sync and
use atomic increments/decrements for individual choice counts.

Fixes SimpleMachines#9590

Signed-off-by: Mattia Agostini <agostini.19@gmail.com>
@github-actions github-actions Bot added the Polls label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[3.0]: Guests told they can't edit polls when trying to vote

1 participant