Index: aggregator2.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/aggregator2/aggregator2.module,v retrieving revision 1.35 diff -u -r1.35 aggregator2.module --- aggregator2.module 26 Apr 2006 01:29:04 -0000 1.35 +++ aggregator2.module 14 Jul 2006 14:40:40 -0000 @@ -1982,7 +1986,12 @@ $edit->sticky = in_array('sticky', $node_options); $edit->revision = in_array('revision', $node_options); - $edit->taxonomy = $feed->feed_item_taxonomy; + $terms = module_invoke('taxonomy', 'node_get_terms', $edit->fid, 'tid'); + foreach ($terms as $tid => $term) { + if ($term->tid) { + $edit->taxonomy[$tid] = $term; + } + } unset($edit->path); // avoid path alias conflicts! unset($edit->parent_node); // avoid messing up relativity module's data :) Index: aggregator2_autotaxonomy.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/aggregator2/aggregator2_autotaxonomy.module,v retrieving revision 1.9 diff -u -r1.9 aggregator2_autotaxonomy.module --- aggregator2_autotaxonomy.module 16 Jun 2006 17:47:46 -0000 1.9 +++ aggregator2_autotaxonomy.module 14 Jul 2006 14:40:40 -0000 @@ -46,6 +46,7 @@ switch($op) { case 'insert': case 'update': + case 'prepare'; // If the RSS item has any category tags, add new ones to taxonomy if needed if (count($categories) > 0) { if (!isset($node->taxonomy) || !is_array($node->taxonomy)) { @@ -60,7 +61,8 @@ $category_name = strtolower($category_name['VALUE']); } - if (trim($category_name) != '') { + $category_name = trim($category_name); + if ($category_name != '') { if (!isset($cat_names[$category_name])) { $cat_names[$category_name] = module_invoke('taxonomy', 'get_term_by_name', $category_name); } @@ -72,16 +74,23 @@ $term['description'] = t('Auto generated by aggregator2 autotaxonomy'); $term['vid'] = $vocab; $term['weight'] = 0; - $term = taxonomy_save_term($term); - $node->taxonomy[] = $term['tid']; - $cat_names[$category_name][0]->tid = $term['tid']; + // broken + //$term = taxonomy_save_term($term); + taxonomy_save_term($term); + $terms = taxonomy_get_term_by_name($term['name']); + foreach ($terms as $term) { + $node->taxonomy[$term->tid] = $term; + } } - else { + else { // Use the existing category term in the database if (!in_array($cat_names[$category_name][0]->tid, $node->taxonomy)) { - $node->taxonomy[] = $cat_names[$category_name][0]->tid; + $terms = taxonomy_get_term_by_name($cat_names[$category_name][0]->name); + foreach ($terms as $term) { + $node->taxonomy[$term->tid] = $term; + } } } } } }