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!

Comments

Exploratus’s picture

subscribe

peter.walter’s picture

StatusFileSize
new2.01 KB

my spin as a .patch file

YK85’s picture

subscribing

amorsent’s picture

See 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.

amorsent’s picture

One thought .... the hook_views_api implementation should probably be in the fivestar_comments.module not the fivestar.module

amorsent’s picture

Rerolled 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.

hitfactory’s picture

Confirming patch worked for me

vkareh’s picture

Status: Needs review » Reviewed & tested by the community

Works well for me. You might also need the fix posted in this thread for proper functionality: #601160: Comment-cast ratings not deleted with comment

whiteph’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (won't fix)

Sorry, Drupal 6 is end of life, and is no longer supported.