I was using a view to display the top product review for a number of ubercart products, and noticed that the fivestar vote value that was being displayed next to each review was inaccurate. After looking into it, I realized that since voting_api views support isn't aware of the fivestar_comment join table there is no way to associate a vote with a specific comment, since voting_api stores the vote on the node and not on the comment. Therefore, to display a comment in views along with it's associated vote you need to be able to build a relationship through the fivestar_comment table. This requires that fivestar provide basic views support, mainly by just exposing the fivestar_comment table to views so that you can build relationships using it. If you don't do this, you basically get a record for every possible vote and comment combination, and you end up with comments displaying votes that are incorrect.
I've attached the changes I performed as a patch... Comments appreciated!
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | fivestar_comment_vote_id_views_relationship.patch | 2.01 KB | amorsent |
| #2 | fivestar_view_relationship.patch | 2.01 KB | peter.walter |
| fivestar-views.zip | 1.1 KB | stockliasteroid |
Comments
Comment #1
Exploratus commentedsubscribe
Comment #2
peter.walter commentedmy spin as a .patch file
Comment #3
YK85 commentedsubscribing
Comment #4
amorsent commentedSee also: http://drupal.org/node/497888
The issues are somewhat related because the view relationship does no good if the vote_ids are all 0.
Lets pack a 6.x-1.20 release addressing these issues eh? It's been over a year since the 6.x-1.19 release.
Comment #5
amorsent commentedOne thought .... the hook_views_api implementation should probably be in the fivestar_comments.module not the fivestar.module
Comment #6
amorsent commentedRerolled so that the views relationship is associated with the fivestar_comment module not fivestar itself. Fivestar Comments is providing the table and managing the relationship, it should provide the views integration as well.
Comment #7
hitfactory commentedConfirming patch worked for me
Comment #8
vkareh commentedWorks well for me. You might also need the fix posted in this thread for proper functionality: #601160: Comment-cast ratings not deleted with comment
Comment #9
whiteph commentedSorry, Drupal 6 is end of life, and is no longer supported.