By TheOldGuy223 on
I not sure why this has been so hard to figure out,
I have a nodereferance field that the user sets when they create a node: "field_campaign"
I usually use contemplate to find the variables of a node I can use and using that I found that I can print the name of the node reference field using:
print $node->field_campaign[$node->language][0]['safe_value'];
So using Rules, When the node is created Im trying to add the value of this field to a variable
$campaign = $node->field_campaign[$node->language][0]['safe_value'];
Except that when I do that I get an error:
Notice: Undefined index: safe_value in eval() (line 6 of mysite/sites/all/modules/rules/modules/php.eval.inc(146) : eval()'d code).
Im not sure why I cant assign this variable, any ideas?
Comments
Additionally, Contemplate
Additionally, Contemplate states I can use the following to return the same value:
when when I try to assign this value to a variable I get 2 errors this time
Notice: Undefined index: node in eval() (line 6 of mysite/sites/all/modules/rules/modules/php.eval.inc(146) : eval()'d code).
Notice: Trying to get property of non-object in eval() (line 6 of mysite/sites/all/modules/rules/modules/php.eval.inc(146) : eval()'d code).
Try this:<?php$campaign =
Try this:
You can check this:
http://drupal.org/node/1601226
Try this:<?php$campaign =
Try this:
You can check this:
http://drupal.org/node/1601226