? feeds-652180-2.patch ? feeds-standalone-assignuser.patch Index: plugins/FeedsNodeProcessor.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/feeds/plugins/FeedsNodeProcessor.inc,v retrieving revision 1.34 diff -u -p -r1.34 FeedsNodeProcessor.inc --- plugins/FeedsNodeProcessor.inc 16 May 2010 21:24:50 -0000 1.34 +++ plugins/FeedsNodeProcessor.inc 16 Jun 2010 18:14:40 -0000 @@ -21,6 +21,14 @@ class FeedsNodeProcessor extends FeedsPr // Keep track of processed items in this pass. $processed = 0; + + //Set the default user to be assigned as author of nodes. + $assigned_user = 0; + + //Check if Feed Importer is standalone and assign user base on form setting. + if (feeds_importer($this->id)->config['content_type'] == '') { + $assigned_user = user_load(array('name' => $this->config['explicit_author'])); + } while ($item = $batch->shiftItem()) { @@ -60,7 +68,8 @@ class FeedsNodeProcessor extends FeedsPr // Populate properties that are set by node_object_prepare(). $node->log = 'Created/updated by FeedsNodeProcessor'; - $node->uid = 0; + $node->uid = $assigned_user; + // Map and save nodes. If errors occur don't stop but report them. try { @@ -172,6 +181,7 @@ class FeedsNodeProcessor extends FeedsPr 'update_existing' => 0, 'expire' => FEEDS_EXPIRE_NEVER, 'mappings' => array(), + 'explicit_author' => 'anonymous', ); } @@ -202,6 +212,22 @@ class FeedsNodeProcessor extends FeedsPr '#description' => t('Check if existing items should be updated from the feed.'), '#default_value' => $this->config['update_existing'], ); + + //If Feed Importer is not attached to a content type we give user the chance to assign author. + if (feeds_importer($this->id)->config['content_type'] == '') { + $form['node_author'] = array( + '#type' => 'fieldset', + '#title' => t('Feed Results Author'), + ); + $form['node_author']['explicit_author'] = array( + '#type' => 'textfield', + '#title' => t('Author for created nodes'), + '#description' => t('Explicitly set the user that will be set as author of nodes'), + '#autocomplete_path' => 'user/autocomplete', + '#default_value' => $this->config['explicit_author'], + ); + } + return $form; }