Closed (fixed)
Project:
Poll
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Jun 2006 at 06:20 UTC
Updated:
28 Nov 2019 at 22:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gábor hojtsyThis sounds like a UI improvement, definitely not a fix. Goes to Drupal 7.
Comment #2
jody lynnComment #3
alexpottPoll is no longer part of core
Comment #4
adammaloneIn 8.x, when we determine if the user is allowed to vote on a poll, we check if they have voted prior. The hasUserVoted method actually returns an array including the choice the user made. My thought is that it would be relatively simple to feed that choice into the template and add a class to the appropriate meter if the user voted for that choice. This could then either be left to the site theme to display or included by default in poll module.
Comment #5
lendudeThis adds classes to the selected and non-selected options, this doesn't add any default styling since that would break BC. But with the classes people have the option to style this.
Also adds some minimal test coverage for this and updates the Javascript test to not use phantomJs anymore because, pffff
Comment #7
berdirHuh, previous last comment from 2014, you've been digging deep here ;) And a 5-digit issue from 2006...
It does add another query because getUserVote() isn't statically cached, maybe it should be. But you get bonus points for converting the JS test, so I'll create a follow-up for that: #3094531: Statically cache PollVoteStorage::getUserVote(). And it's already a lazy builder, so not in the critical path.