$description=t('The !name vocabulary of the node. If this is a "Tags" vocabulary, any new terms will be created on import. Otherwise only existing terms will be used. If this is not a "Tags" vocabulary and not a "Multiple select" vocabulary, only the first available term will be created. See !settings.',array('!name'=>$vocab->name,'!settings'=>l(t('vocabulary settings'),'admin/content/taxonomy/edit/vocabulary/'.$vocab->vid,array('query'=>'destination='.$_GET['q']))));
$targets['taxonomy:'.$vocab->vid]=array(
'name'=>"Taxonomy: ".$vocab->name,
'callback'=>'taxonomy_feeds_set_target',
'description'=>$description,
);
}
}
/**
* Callback for mapping. Here is where the actual mapping happens.
*
* @param $node
* Reference to the node object we are working on.
*
* @param $key
* A key as added to the $targets array by
* taxonomy_feeds_node_processor_targets_alter().
*
* @param $terms
* Given terms as array.
*
* Add the given terms to the node object so the taxonomy module can add them
$db_result=db_query(db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t WHERE LOWER(t.name) = LOWER('%s') AND vid=%d",'t','tid'),trim($name),$vid);
// This term should now be missing from term-node associations.
$this->assertEqual(29,db_result(db_query('SELECT count(*) FROM {term_data}')),'Found correct number of terms.');
$this->assertEqual(39,db_result(db_query('SELECT count(*) FROM {term_node}')),'Found correct number of term-node relations.'.db_result(db_query('SELECT count(*) FROM {term_node}')));