Reference a cck node_reference field as the target Node ID for fivestar
foxtrotcharlie - September 24, 2007 - 09:40
| Project: | Fivestar |
| Version: | 5.x-1.7 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I am trying to make the fivestar Node ID target field be set to a node_reference cck field. Does anybody know if this is possible, and if so what the code for the Node ID field in the rating field should be? I tried the following which did not work:
return $node->field_reference_place_add_node[0][value];

#1
subscribe
#2
Try:
return $node->field_reference_place_add_node[0]['nid'];#3
This previously was not possible because Fivestar was using drupal_eval() to call the PHP code. This means that the code did not have access to any of the local variables (such as $node). I've switched this to a normal eval() call so the $node variable is now available. This should be in the 1.11 final release and in beta 4 to be posted shortly.
After upgrading, the solution posted by aaustin should work.
#4
Automatically closed -- issue fixed for two weeks with no activity.