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

wbmangy - January 18, 2008 - 14:05

subscribe

#2

aaustin - January 29, 2008 - 20:43

Try:

return $node->field_reference_place_add_node[0]['nid'];

#3

quicksketch - February 23, 2008 - 18:41
Status:active» fixed

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

Anonymous (not verified) - March 8, 2008 - 18:42
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.