Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there a way to set node author to anonymous?
All I see for actions are setting to acting user and current user?
Comments
Comment #1
ManyNancy CreditAttribution: ManyNancy commentedI mean content's author and acting user.
Comment #2
Les LimThat 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.
Comment #4
rich.yumul CreditAttribution: rich.yumul at Sage Tree Solutions commentedJust 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
Comment #5
AldenC CreditAttribution: AldenC commentedI 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!
Comment #6
capysara CreditAttribution: capysara commentedI used these steps to change my entityform submissions to anonymous and it worked perfectly!
Thanks, rich.yumul!