I created a node but did not vote on it (i.e. no fivestar rating at all)

I created a view which provided a page with a list view of my poll nodes. I added a "VotingAPI percent vote result" to the list. I selected "Fivestar rating" from the handler.

When I accessed my page view, there was nothing in the in the fivestar field, as in the field was empty. Not until I voted at least once does anything show up.

I think there should definitely be something, some empty starts or the words "no votes yet" displayed if there are no votes, otherwise, it looks like an error in the website.

CommentFileSizeAuthor
#2 fivestar_views_widget.patch4.99 KBquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mgrant’s picture

This bug can be fixed if you provide a way to display the voting widget in the table/list view instead of just the number of stars. That way, if there's no votes, you get voting widget telling you there's no votes yet AND people can vote on things right from the list view which is very natural.

In fact, thinking about this, this is necessary. If you only display the number of stars and not let people vote, it frustrates the user who does not know they have to click on the title to vote. It's not intuitive.

quicksketch’s picture

Category: bug » task
Priority: Critical » Normal
Status: Active » Needs review
FileSize
4.99 KB

I agree with the points you've made here. Fivestar should probably display an empty set of stars when there haven't yet been any votes. As for things being intuitive or not, it depends on how you've framed the view and your theming.

Rather than changing the behavior of existing views from a static-widget to one that's clickable, this patch provides two more options when displaying a VotingAPI Average value: Fivestar Stars (clickable, with text) and Fivestar Stars (clickable, no text). I had originally put the entire widget in the view, but not only did it look weird with the title on every widget, it also wasn't efficient. So now this provides two options for a clickable widget.

Could you review this patch and tell me if it seems like the most natural solution?

WISEOZ’s picture

Hello! I was looking for an answer to a similar problem and found this patch. I've applied the patch and it seems to work as advertised. My additional needs that may be appropriate for this patch are ...

1) Sort order to be corrected. When you sort descending on "VotingAPI percent vote result" in a view, it displays the no vote items before it displays the highest rated items.

2) Exposed Filter that displays the actual voting selections, "Good", "Bad", "Poor", etc. The Exposed Filter feature for "VotingAPI percent vote result" just isn't user friendly.

quicksketch’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the additional input WISEOZ, with your validation that it works as advertised I'll go ahead and commit the changes. Your other requests would be better served in other places though, as they're not directly related to the problem described in the original issue. The exposed filter request could probably be a part of http://drupal.org/node/161426.

Marked http://drupal.org/node/231616 as duplicate.

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Please reopen if any bugs were introduced by this addition.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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