Unable to vote through views
| Project: | Fivestar |
| Version: | 6.x-1.18 |
| Component: | Code |
| Category: | support request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I can read through Views, but not successfully vote through Views...
I have a setup where I only want a user to be able to vote on a Document after they have purchased it. To that end, i have created an additional Feedback node that the user will gain access to only when the Document is purchased. I have added a node reference and rating CCK fields to the Feedback node, and enabled fivestar rating in the Document node.
All working so far. A user can go to the Feedback node and vote on the Document, and the Document vote status is updated.
My problem is that I would like to be able to this from a View which contains a list of many Feedback nodes.
I've tried all the following fields in the View:
"Fivestar: Rating (field_rating)" - this correctly provides the rating for Document, but does not give an option for issuing a vote on Document
"VotingAPI percent vote value" - this does not work in either read or write voting on Document
"VotingAPI percent vote user" - this does not read
"VotingAPI percent vote value(current user)" - this does not work in either read or write on Document
"VotingAPI percent vote result(avg)" - this does not work in either read or write on Document
"VotingAPI percent vote result(count)" - this does not work in either read or write on Document
Great module, a little help getting past this final hurdle would be much appreciated(!)

#1
Have you watched the Videocast on Views + Fivestar? I think it covers this exact use case. http://www.lullabot.com/videocast/building-views-fivestar-and-votingapi
#2
Yes I did actually, it's for version 6 and i'm on 5, but I watched it all to see if there was something i missed.
I dont a have a problem getting it to work in views in general, only in the specific case where the view lists node x, where node x is casting a vote on node y (where node y is not contained in the view). Also, only in the 'cast vote' case, since the view can display the vote result of node y perfectly.
And since i've tried every possible fivestar and voteing API field in the view, I'm wondering what configuration I could have got wrong.
#3
Views 1 is not capable of doing what you're describing. In Views 1, the only thing that Fivestar is capable of is voting directly on the node that is in the listing. This became possible in Views 2 with the introduction of relationships, but there's no way to do this in the Drupal 5 version.
#4
Actually I just came on this problem with the upgrade to fivestar 1.15. Previous to that, voting worked through views worked fine (1.14). After the upgrade, voting only works on nodes directly, not exposed through views. In views it sits on "Saving your vote". All relevent modules are at their latest release (voting API and Views)
Any ideas?
Example:
http://www.alanlouie.com/node/4660
Clicking on any stars will be stuck at 'saving your vote'
But if you click into a node (click the title or use the link below), clicking on the fivestar will work fine
http://www.alanlouie.com/node/4656
It doesn't work for either logged in or anonymous users (and the permissions are fine)
I have already deleted the whole directory and unzipped 1.15 into it
More information from watchdog
Message : %message in %file on line %line.
Variables: a:4:{s:6:"%error";s:7:"warning";s:8:"%message";s:38:"Missing argument 4 for fivestar_vote()";s:5:"%file";s:60:"/home/aklouie/alanlouie.com/modules/fivestar/fivestar.module";s:5:"%line";i:688;}
Location: http://www.alanlouie.com/fivestar/vote/node/4650//100?token=9c1b1f95bf2e...
Referer: http://www.alanlouie.com/node/4660
#5
Got the same problem as #4 with the current version (6.x-1.18):
I display the fivestar rating widget with Views:
Vote results: Value
Fivestar Stars (clickable, with text)
And if a user clicks to vote, the message "Saving your vote..." appears, but the vote did not get saved. If this very same user votes at the node itself, it gets saved.