diff options
-rw-r--r-- | muamba.install | 2 | ||||
-rw-r--r-- | muamba.module | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/muamba.install b/muamba.install index 2ffc573..bd1a710 100644 --- a/muamba.install +++ b/muamba.install @@ -31,8 +31,6 @@ function muamba_schema() { 'not null' => TRUE, 'default' => 0, ), - // This assumes that the node won't have his author changed, - // which might be reasonable depending on the application. 'owner' => array( 'description' => t('The {user}.owner owner of an item.'), 'type' => 'int', diff --git a/muamba.module b/muamba.module index 5e3880a..1d72289 100644 --- a/muamba.module +++ b/muamba.module @@ -278,3 +278,15 @@ function muamba_views_api() { 'api' => 3, ); } + +/** + * Implements hook_node_update() + */ +function muamba_node_update($node) { + if ($node->type == MUAMBA_NODE_TYPE) { + db_update('muamba') + ->fields(array('owner' => $node->uid) + ->condition('nid', $node->nid) + ->execute(); + } +} |