How can I change the author of a node before it is saved with hook_entity_presave()? I have added code in a node presave hook before cloning a node as below to change it to the current user id

 $entity-&gt;setRevisionAuthorId($current_user);


and then I check with $entity->getRevisionAuthor and it has been changed in that presave function, however upon saving the author reverts back to the author of the original node that was cloned.

What is happening ? thanks
I added $entity->setOwnerId($current_user)  and that worked