--- FeedsNodeProcessor 1.16.inc Tue Dec 01 15:49:37 2009 +++ FeedsNodeProcessor.inc Tue Dec 01 15:43:56 2009 @@ -1,5 +1,5 @@ nid = $nid; $node->vid = db_result(db_query('SELECT vid FROM {node} WHERE nid = %d', $nid)); } - - // Save the node. + + if ($this->config['taxonomy_inheritance'] && module_exists('taxonomy')){ + //Find out what term(s) the parent node uses + //Use node_load to get the parent information (see http://api.drupal.org/api/function/node_load/6). + $feed_node = node_load($source->feed_nid); + //Set node to use the same taxonomy term(s) as it's parent + $node->taxonomy = $feed_node->taxonomy; + } + + // Save the node. node_save($node); if ($nid) { @@ -147,6 +155,7 @@ class FeedsNodeProcessor extends FeedsPr return array( 'content_type' => $type, // @todo: provide default content type feed_item. 'update_existing' => 0, + 'taxonomy_inheritance' => 0, 'expire' => FEEDS_EXPIRE_NEVER, 'mappings' => array(), ); @@ -171,6 +180,12 @@ class FeedsNodeProcessor extends FeedsPr '#description' => t('Check if existing items should be updated from the feed.'), '#default_value' => $this->config['update_existing'], ); + $form['taxonomy_inheritance'] = array( + '#type' => 'checkbox', + '#title' => t('Taxonomy Inheritance'), + '#description' => t('Nodes inherit taxonomy terms from Feed Node.'), + '#default_value' => $this->config['taxonomy_inheritance'], + ); $period = drupal_map_assoc(array(FEEDS_EXPIRE_NEVER, 3600, 10800, 21600, 43200, 86400, 259200, 604800, 604800 * 4, 604800 * 12, 604800 * 24, 31536000), 'feeds_format_expire'); $form['expire'] = array( '#type' => 'select', @@ -282,7 +297,7 @@ class FeedsNodeProcessor extends FeedsPr $files = drupal_system_listing('.*\.inc$', $path, 'name', 0); foreach ($files as $file) { if (strstr($file->filename, '/mappers/')) { - require_once("./$file->filename"); + require_once("./$file->filename"); } } // Rebuild cache.