Closed (fixed)
Project:
Fivestar
Version:
5.x-1.9
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2008 at 02:38 UTC
Updated:
5 Oct 2008 at 22:07 UTC
I've installed the cck, voting api, and fivestar modules and followed the instructions in the fivestar docs about adding a custom cck field for reviews. The problem is that I have tried every php code I can find to place in the "Target Node ID:" section to generate the nid.. but nothing seems to work for me.
Can anyone help?
Comments
Comment #1
quicksketchCould this be the same case as http://drupal.org/node/243012?
Comment #2
shadow_jh commentedI did see that post, but it doesn't seem to offer the same situation. Just to be safe, I did try the php code offered in the post to no effect.
Comment #3
quicksketchCool, just checking. What setup are you trying to use to create reviews? Could you describe how reviews are related to their parent nodes, and what code you've tried in the Target ID box.
Comment #4
shadow_jh commentedSure, thanks for the help by the way :)
Im following the instructions laid out here under "Configuration as a CCK field / Advanced Rating":
http://drupal.org/handbook/modules/fivestar
Its this part that HORRIBLY vague:
here are a couple of the "solutions" that I have found in various threads:
Comment #5
shadow_jh commentedThis is probably important information:
I couldn't get fivestar to work at all with views and the voting api using drupal 6.. So I went with version 5 and all of the latest module versions built for drupal 5.
Another important observation:
Also, if I enable fivestar on the parent node itself as well as for the cck field, I can vote on the node from the front end, then edit the original review (parent node) and the cck field fivestar rating will then register.
Comment #6
quicksketchYeah Drupal 6 VotingAPI/Views isn't *quite* ready for primetime. Give them 2-3 weeks and things will be chipper. If you've got a decent timeline you should stick with 6, better start on 6 than have to upgrade later :P
I don't think the suggestions to use "print" will work, you should always be returning.
This should work as long as you were accessing the node form like this:
node/add/review?target=20Of course if $_GET['target'] is empty that's not going to work. So if the user goes back and edits the node the review rating won't be updated on the target node.
Comment #7
shadow_jh commentedYeah I would think that would work too... but it doesn't :{
Im not even doing anything custom, Im just doing what is in the manual. If this feature is no longer supported it should be removed. Even the "simple" example of placing a specific node id in the NID field doesn't work! Im starting to think that the field itself is broken...
Comment #8
quicksketchI'm pretty sure the feature works. Please don't tell me to take out a feature just because it's being troublesome. I could just as easily tell you you to not to use the module because you can't figure it out.
Here's a video demonstrating using $_GET['target'] approach. The node on the front page (129) has a rating of 5 stars, I set it to 1 star with the normal widget, then submit a "link" node type that reviews that node and sets it back to 5 stars. Please excuse all the random fields and debugging information everywhere, it's my dev site.
http://quicksketch.org/sites/quicksketch.org/files/Fivestar-target.mov
Comment #9
shadow_jh commentedNo need to get defensive.
The five star rating is being saved in the node it just isn't being sent to the voting api table. So yes, once saving the node, the rating does display on the user end as displayed in your video. This is just as described in the docs:
So while fivestar itself is functioning properly, it isn't successfully passing the vote to the votingapi when used with the cck field.
Comment #10
quicksketchI review one node with another one. The new node reviews the first one and affects it's rating.
Comment #11
quicksketchThe Fivestar CCK implementation has a new approach in the 1.13 version of the module, which is much more reliable. It integrates with nodereference fields directly, so you don't have to use PHP code any longer. Please open a new request for questions about the new implementation, I'm closing this issue as it no longer applies to the new version.