@@ -40,19 +70,14 @@ class FeedsTermProcessor extends FeedsProcessor {
continue;
}
// Add term id if available.
if(!empty($tid)){
$term['tid']=$tid;
}
// Save the term.
$term['importer_id']=$this->id;
$term['feed_nid']=$source->feed_nid;
taxonomy_save_term($term);
if($tid){
$status=taxonomy_save_term($term);
// Track new and updated terms.
if($status===SAVED_UPDATED){
$updated++;
}
else{
elseif($status===SAVED_NEW){
$created++;
}
}
@@ -64,8 +89,8 @@ class FeedsTermProcessor extends FeedsProcessor {
drupal_set_message(
format_plural(
$no_name,
'There was @number term that could not be imported because their name was empty. Check mapping settings on Taxomy term processor.',
'There were @number terms that could not be imported because their name was empty. Check mapping settings on Taxomy term processor.',
'There was @number term that could not be imported because its name was empty. Check the mapping settings for the associated taxonomy term processor.',
'There were @number terms that could not be imported because their names were empty. Check the mapping settings for the associated taxonomy term processor.',
array('@number'=>$no_name)
),
'error'
@@ -113,19 +138,25 @@ class FeedsTermProcessor extends FeedsProcessor {
$tid=db_result(db_query("SELECT tid FROM {feeds_term_item} WHERE feed_nid = %d AND id = '%s' AND %s = '%s'",$source->feed_nid,$this->id,$target,$value));
break;
case'name':
$vocabulary=$this->vocabulary();
if($tid=db_result(db_query("SELECT tid FROM {term_data} WHERE name = '%s' AND vid = %d",$value,$vocabulary->vid))){
return$tid;
$tid=db_result(db_query("SELECT tid FROM {term_data} WHERE name = '%s' AND vid = %d",$value,$vocabulary->vid));