Closed (fixed)
Project:
Rules
Version:
6.x-1.1
Component:
Rules Engine
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Oct 2009 at 04:23 UTC
Updated:
7 Oct 2009 at 12:59 UTC
The rest of my triggered rule is working correctly, but when I add a PHP action, I get this error:
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in .../includes/database.mysqli.inc on line 323.
This is the PHP code I have in the action. I can't seem to find a good example to follow for this, so I am guessing there is something wrong with my snippet. $node_added does not appear to be altered by this action.
$node_added->body = $node->field_sc_introduction;
return array("node_added" => $node_added);
Comments
Comment #1
yowzer commentedFixed my own problem with a shower realization. Switching the first line of the PHP action to the following fixed it. I was forgetting that most (all?) CCK fields need to be referenced this way.
$node_added->body = $node->field_sc_introduction[0]['value'];