--- mappers/feedapi_mapper_node.inc.orig 2010-07-15 12:55:58.070180013 +0100 +++ mappers/feedapi_mapper_node.inc 2010-07-15 12:55:32.362733816 +0100 @@ -14,10 +14,10 @@ */ function node_feedapi_mapper($op, $node, $feed_element = array(), $field_name = '', $sub_field = '') { if ($op == 'describe') { - return t('Maps a feed element to the title, created date, published state or body of a node. Note that standard field mapping by FeedAPI still applies. For example if there is no feed element mapped to the node body you will still find the description in node body because that is how FeedAPI stores nodes.'); + return t('Maps a feed element to the author, title, created date, published state or body of a node. Note that standard field mapping by FeedAPI still applies. For example if there is no feed element mapped to the node body you will still find the description in node body because that is how FeedAPI stores nodes.'); } else if ($op == 'list') { - return array('title' => t('Title'), 'created' => t('Published date'), 'body' => t('Body'), 'status' => t('Published state')); + return array('author' => t('Author'), 'title' => t('Title'), 'created' => t('Published date'), 'body' => t('Body'), 'status' => t('Published state')); } else if ($op == 'map') { if (in_array($field_name, array('title', 'body', 'created'))) { @@ -32,5 +32,11 @@ } return $node; } + else if ($field_name == 'author') { + // look up and set node uid + $user = user_load(array('name' => $feed_element)); + $node->uid = $user->uid; + return $node; + } } }