Is there a way to set node author to anonymous?

All I see for actions are setting to acting user and current user?

Comments

ManyNancy’s picture

Component: Rules Core » Rules Engine

I mean content's author and acting user.

Les Lim’s picture

Status: Active » Fixed

That particular action doesn't allow you to specify a separate UID for the node author, so it won't work for your purposes. You'll have to use the "Execute custom PHP code" action instead. You'll want to put the following line in the PHP Code area:

$node->uid = 0;

UID 0 is reserved for the anonymous user. This should do the trick.

Status: Fixed » Closed (fixed)

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

rich.yumul’s picture

Component: Rules Engine » Rules Core
Issue summary: View changes

Just in case anybody is still wrestling with this,

1) Load up the anonymous user, by loading up and entity:

Fetch entity by id
Parameter: Entity type: User, Identifier: 0
Provides variables: Anonymous (anon)

2) Set the node:author to this new loaded entity:

Set a data value
Parameter: Data: [node:author], Value: [anon]

HTH

AldenC’s picture

I just want to take a moment to thank you rich.yumul for posting this solution. Too often I benefit from the postings without letting contributors know how much time and frustration you save us novice types. This posting saved me hours of being able to write a rule to do something much more quickly. Thank you for sharing your expertise!

capysara’s picture

I used these steps to change my entityform submissions to anonymous and it worked perfectly!

Thanks, rich.yumul!