I'm following this videocast tutorial = http://www.lullabot.com/videocast/building-views-fivestar-and-votingapi

I've installed: (but also tried to use lastest -dev versions of votingapi and fivestar)
views-6.x-2.x-dev (dated: June 3, 2009, 20:29)

Fivestar settings on content type:
Star display style: Display user vote value
Text display style: Current Average in text

I've set up a node view in a page display

The relationship setup:
Node: Individual Votes
Value type = percent
Vote tag = vote
Restrict to current user = TRUE (checkbox is checked)

The field setup:
(Individual votes) Voting API votes: Value
Appearance = Fivestar Stars (clickable, no text)
Relationship = Individual votes

The expected behavior is:
a user viewing the view who hasn't voted on any of the content would recieve the fivestar voting wiget with 0 stars colored

The behavior I am getting is:
A user who is viewing the view is presented with a clickable widget that already has stars selected which seem to be displaying the "average" vote.

This is confusing as users believe they've already voted or someone else has voted using their username.

I am expecting the wrong behavior?

I can provide a link to the site, screenshots or a videocast if needed as I can't find where I've strayed from the video tutorial.

#3 fivestar_views_user_rating.patch2.3 KBquicksketch
Members fund testing for the Drupal project. Drupal Association Learn more


ahjota’s picture

Version: 6.x-1.x-dev » 6.x-1.15

Subscribing, because I'm having the exact same problem on a live site. However, the module versions I am using are:

Drupal core 6.12

VeryMisunderstood: Your expectations are fine; you can see the correct behavior in that Lullabot video.

groenm’s picture

I am experiencing the same, or even worse: the clickable widgets always show the average vote, even if the user has already voted. The user's vote is obtained from the database though, because when I change appearance to "Fivestar (clickable, with text)", the text correctly shows the user's vote and the average vote. Also: sorting the column in views, sorts it by user vote, although the stars show the average.

Core: 6.12
Fivestar: 6.x-1.15
Voting API: 6.x-2.0-rc2
Views: 6.x-2.6


quicksketch’s picture

Status: Active » Fixed
2.3 KB

This problem looks like it's caused by Fivestar trying to use the node-type settings when displaying the view, rather than the data that the view is passing in. Obviously this is quite flawed, since we should be using the value Views provides us, not retrieving the average even though we're wanting to display the user's vote.

This patch checks the field type and uses the values passed in by Views rather than pulling in the results all over again. It also fixes the issue of always displaying an average even when the user's vote is intended.

quicksketch’s picture

Title: Avg votes shown in view, even with restrict to current user checked » Average vote shown in Views, even when displaying user's vote
VM’s picture

confirmed. This fixes the issue. I added it to fivestar 2.x-dev Dated: June 30, 2009 - 20:10

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.