Closed (fixed)
Project:
Fivestar
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
9 Feb 2011 at 11:00 UTC
Updated:
27 Mar 2013 at 03:35 UTC
Jump to comment: Most recent file
hi
when i add a fivestar cck field on a content type on a fresh drupal 7 installation i can't set the destination node (i created a node reference field with the references module: http://drupal.org/project/references)
if i set the php code in this way
return $node->field_myfield[0]['nid'];
the php code is not saved and i receive always this error
No potential target fields are available for the xxxxxxxxx bundle. Create a node reference field in this bundle to make it easier to assign a vote to a node.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | target_version-1056046-3.patch | 1.42 KB | mdixoncm |
Comments
Comment #1
josh@pixael.com commentedi solved this issue changing the line from 47 to 55 of fivestar.field.inc in this way
Comment #2
generalconsensus commentedWhen I perform that I get the error:
"Notice: Undefined offset: 0 in fivestar_field_formatter_view() (line 284"
Comment #3
mdixoncm commentedComment #1 nearly worked for me, although there was an issue when using with a nodereference field that had been used on multiple content types.
I've had a pop at fixing this in a generic way, patch attached.
Comment #4
tresero commentedConfirm #2, this patch doesn' t work.
also, Fatal error: Unsupported operand types in xxx/drupal-7.0/includes/theme.inc on line 817
Comment #5
ericduran commentedBased on the preview comment.
Comment #6
magda_ commentedSubscribing.
This is a mayor problem for me, any solutions in sight?
Comment #7
ericduran commentedOk, this is a big priority item. Working on this now.
Comment #8
cfbauer commentedSubscribing
Comment #9
agence web coheractio commentedSubscribing
Comment #10
ericduran commentedClosing #1132044: PHP target doesn't work as a duplicate of this issue. Also that issue has a patch attached to it.
Comment #11
ericduran commentedThanks for everyones patient.
This has been fixed in the latest master branch, It should be available in the next dev release, Usually 12 hours.
Commit http://drupal.org/commitlog/commit/2490/ee4fbd611396efc9e995ce9d0ddd061e...
Comment #12
ericduran commentedOh almost forgot, If you're using a php code for the ratings you will now have to use $entity instead of $node. The code is slowly being abstracted out to support any entity not just node.
Comment #13
OldAccount commentedCan you please share more info on how you set up the node reference field? I want to add Fivestar ratings to the comments section for my custom content type. I have the References module installed and added a Node Reference field to the Comment fields but am not sure it's set up right because it still says "No potential target fields are available for the comment_node_product bundle. Create a node reference field in this bundle to make it easier to assign a vote to a node."
So I think I'm missing a step or something, I'd love some more clarification on how you got this to work. Thanks!
Comment #14
ericduran commented@lrobeson, if you're using the fivestar field on a comment, you do not need to use a node reference. There will be an option called parent node which will automatically target the node you're commenting on.
The node reference field is for when you want to do more complicated rating systems.
I'll take some time to update the docs for the drupal 7. Maybe even shoot a video. I want to wait till the module is completely ready that way we can have extremely good docs.
Comment #16
elly commentedRe-opening this, maybe not wisely as this might just be a support request...
I'm working off the 7.x-2.x-dev release from May 19 that's on the module page. What should I see when I am adding a fivestar field that needs to target another node?
I have a 'review' content type with a node reference field, and the behavior I expect is that when I add a fivestar field to my review type, under 'Voting Target' I should be able to choose the node reference field from the pulldown, but it just says 'none' in the pulldown.
Am I thinking about this wrong? Should I use PHP as described by the original poster in this thread? Or is this still not working?
Comment #17
elly commentedComment #18
elly commentedOho, nevermind, I had the wrong version installed in my sandbox. Carry on.
Comment #19
pcorbett commentedI didn't want to create an entire new issue, so I'll re-open this one for a question.
I see there is target code in the 7.x-2.x branch, but I don't see where I can actually set a target/destination node. Basically, I'm attempting to create a review node with fivestar cck fields with a node reference (using the Entity Reference module) to another content type that is to be reviewed. I'm at the stage where I've got a view listing all scores based on each fivestar field tag. At this point, it's pulling data, but there are duplicates (likely due to the fact that two people reviewed the same piece of content -- which is desired).
There's a lot of documentation on multi-access rating systems, but all for 6.x or seemingly for a 7.x-2.x branch code that no longer is being utilized by the module?
Suggestions for how to properly do this?
Comment #20
pcorbett commentedOkay, I'm hoping this is just a documentation thing, but I followed http://drupal.org/node/1308114 and it seems that the only way to get a target option on a fivestar field is to add the field in the "comment fields" area of a content type versus the "manage fields" area. Is this correct? If so, it looks like then I'll need to install a different node reference module other than Entity Reference. Does this make sense?
Comment #21
pcorbett commentedClosing this, I'll update the docs, but as it stands now the Entity Reference module isn't compatible with Fivestar but the References module is and I am able to specify a target on the normal Fivestar field in the Manage Fields area. Closing.
Comment #22
kolafson commentedThe references module appears to be nearing end of life. Quote from the project page:
"References will most probably be deprecated in the near future in favor of Entity Reference, which should probably be considered first on fresh D7 projects. Another, more radical, alternative would be the Relation module."
It looks like Entity Reference is the preferred method now. As a result, I am unsure how to move forward with a review site I am working on.
My options at the moment appear to be:
Option 1) Add fields to comments to make them better for reviews, but then I lose normal comment functionality which I also want.
Option 2) Go ahead with a separate Review content type and use the references module for now. This might mean serious problems in the future if it is no longer supported
Comment #23
bsandor commentedFor Entity Reference module see http://drupal.org/node/1488914