I have been reading around this for two days now, but I cannot get it solved. I don't want yet another module (there are ways with content_profile or something), but I want to solve this with rules and the core profile.
What I am trying to achieve is to
- trigger when a user is created (works),
- create a node (works)
- write the nid of that node into a custom-profile field (this is my problem)
My current try is to use something like the following in "Execute custom PHP code"
$account->profile_homegroup=$node_added->nid;
return array("account" => $account);Both variables ($account and $node_added) are reported to be available, so it probably is a syntax thing or something?
Would appreciate any help. Will write this down to the handbook or FAQ, if someone just explains it to me, as I couldn't find any PHP-example writing content at all, not even talking about this profile issue.
Comments
Comment #1
Tim_O commentedI managed to achieve this by the following rules:
1) saving my modified node using "save content"
2) loading that content again using a token for the node-id
3) then using the following code in a "custom php" rule:
I will try to add something to the documentation on this as well.
Comment #2
Tim_O commentedI've put some documentation at http://drupal.org/node/632140 ...