I am using workflow_ng to node factory api to create a node on creation of another node. The created node shows as created by "Guest"

How to set the author of the created node same as author of the triggering node?

Comments

gjfreakout’s picture

Priority: Normal » Critical

Any suggestions

clemens.tolboom’s picture

Assigned: Unassigned » clemens.tolboom
Priority: Critical » Normal
Status: Active » Fixed

Setting priority for a support request is not nice. Yes you got attention this way :p

I changed the documentation by adding uid to the first example code.

Hope that helps :-)

gjfreakout’s picture

Thanks. It Worked.

Sorry, for setting priority but again worked for me to get your attention. I don't know which way to go next time :).

clemens.tolboom’s picture

So the docs where not enough :p

node_factory_set_value( $edit, 'uid', 321);

Workflow gives a context ifaik ... so either use the created node->uid or

global $user;
node_factory_set_value( $edit, 'uid', $user->uid);

Status: Fixed » Closed (fixed)

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