I recently had a need for a sort of 'extended' node author field. Here's a patch to add a "Set to AUthor on Node Creation" option to userreference fields.

On node creation it ignores whatever the user entered (or, if the field is hidden by the content_permission module) and sets the value to the current user's UID.

CommentFileSizeAuthor
author.patch1.8 KBsean.mtm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

muschpusch’s picture

Hey,

i would need same functionality could you provide a patch for the current CCK version?

thanks Volkan

filpet’s picture

Yes please,

i need this functionality too!
The old patch does not work with the new version!

Kindly,
Peter

muschpusch’s picture

I found another way to do this... Just add custom code to the default value of your CCK reference field:

global $user;
if($user->uid!=1){
return array( 0 => array('uid' => $user->uid) );
}
else return array();

mogop’s picture

but still shows other users.
any way to show only UID which is creating the node?