Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | fivestar_views_widget.patch | 4.99 KB | quicksketch |
Comments
Comment #1
mgrant CreditAttribution: mgrant commentedThis 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.
Comment #2
quicksketchI 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?
Comment #3
WISEOZ CreditAttribution: WISEOZ commentedHello! 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.
Comment #4
quicksketchThanks 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.
Comment #5
quicksketchCommitted. Please reopen if any bugs were introduced by this addition.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.