Hello,
I've always lived a happy life thinking that the uid
field in the node
table contained the user ID of the user who created the node.
But in a custom node module I'm developing, the following happens:
- user with id 8 creates a node
- uid = 8 for this node (in the node table), everything is perfect
- then, user 1 (admin) does his webmaster's job by cleaning up and editing this node
- now, uid = 1 for this node (in the node table)
Does it mean node.uid stores the user ID of the user who last modified the node, or did I do something wrong?
Any help on that will be greatly appreciated.
Thanks,
Vincent
PS. By looking around line 445 in node.module
($Id: node.module,v 1.641.2.12 2006/07/26 12:12:27 killes Exp $), it does seem uid
is initialised with $node->uid
(the previous user ID), and not $user->uid
(the current user ID). Therefore, the node should retain its initial uid (8 in my example). I'm puzzled...
<?php
$node_table_values = array('nid' => $node->nid, 'vid' => $node->vid,
'title' => $node->title, 'type' => $node->type, 'uid' => $node->uid,
'status' => $node->status, 'created' => $node->created,
'changed' => $node->changed, 'comment' => $node->comment,
'promote' => $node->promote, 'moderate' => $node->moderate,