Closed (fixed)
Project:
Fivestar
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Sep 2011 at 17:35 UTC
Updated:
11 Nov 2011 at 11:10 UTC
The _fivestar_get_element_default_value function contains a switch/case block with no breaks in. Result is that the default value is always set to the user's vote (the last case in the block).
Patch attached to add the breaks.
| Comment | File | Size | Author |
|---|---|---|---|
| fivestar-break.patch | 705 bytes | mjpa |
Comments
Comment #1
Georgii commentedI have just tested this. Work like a charm.
Comment #2
iaminawe commentedI am using 7.x-2.x-dev of Voting API and 7.x-2.x-dev Fivestar with this patch applied and my caches cleared.
I have comments with fivestar fields targeting their parent node and on the node I have the fivestar widget being displayed with this code in the template both using the "vote" tag
When I post a comment with a rating, the stars displayed on the node update to reflect the latest vote even though they are using the 'average' function. Posting a new comment and rating updates them to reflect the new most recent vote but still only one most recent user vote is reflected. This sounds like the issue this patch is addressing but does not seem to work for me. Maybe its because I am using fivestar on comments?
Do you have any suggestions as to what I may be doing wrong? Any help would be greatly appreciated.
Thanks in advance
Gregg
Comment #3
iaminawe commentedMy mistake - it does work as intended. I didnt realize that a user could only vote once which is why every time I posted a new rating it would replace the old one. its a feature not a bug!!
Comment #4
reevo commentedThis patch fixes #1304920: Anonymous can rate but can't see anything
Comment #5
ericduran commentedFixed -- http://drupalcode.org/project/fivestar.git/commit/4661bd1
Comment #6
Georgii commentedThanks a lot!