drupal_set_message(format_plural($created,'Created @number term in !vocabulary.','Created @number terms in !vocabulary.',array('@number'=>$created,'!vocabulary'=>$vocabulary->name)));
if($state->created){
}
drupal_set_message(format_plural($state->created,'Created @number term in !vocabulary.','Created @number terms in !vocabulary.',array('@number'=>$state->created,'!vocabulary'=>$vocabulary->name)));
elseif($updated){
}
drupal_set_message(format_plural($updated,'Updated @number term in !vocabulary.','Updated @number terms in !vocabulary.',array('@number'=>$updated,'!vocabulary'=>$vocabulary->name)));
elseif($state->updated){
}
drupal_set_message(format_plural($state->updated,'Updated @number term in !vocabulary.','Updated @number terms in !vocabulary.',array('@number'=>$state->updated,'!vocabulary'=>$vocabulary->name)));
else{
}
drupal_set_message(t('There are no new terms.'));
else{
drupal_set_message(t('There are no new terms.'));
}
}
}
}
}
...
@@ -72,33 +74,59 @@ class FeedsTermProcessor extends FeedsProcessor {
...
@@ -72,33 +74,59 @@ class FeedsTermProcessor extends FeedsProcessor {
* Implements FeedsProcessor::clear().
* Implements FeedsProcessor::clear().
*/
*/
publicfunctionclear(FeedsSource$source){
publicfunctionclear(FeedsSource$source){
$deleted=0;
$state=$source->state(FEEDS_PROCESS_CLEAR);
$vocabulary=$this->vocabulary();
$vocabulary=$this->vocabulary();
$terms=db_query("SELECT td.tid
FROM {taxonomy_term_data} td
// Build base select statement.
JOIN {feeds_item} fi
$select=db_select('taxonomy_term_data','td');
ON fi.entity_type = 'taxonomy_term'
$select->addField('td','tid');
AND td.tid = fi.entity_id
$select->join('feeds_item','fi',"td.tid = fi.entity_id AND fi.entity_type = 'taxonomy_term'");
// Report progress, take into account that we may not have deleted as
// many items as we have counted at first.
if($deleted){
if($deleted){
drupal_set_message(format_plural($deleted,'Deleted @number term from !vocabulary.','Deleted @number terms from !vocabulary.',array('@number'=>$deleted,'!vocabulary'=>$vocabulary->name)));
drupal_set_message(format_plural($state->deleted,'Deleted @number term from !vocabulary.','Deleted @number terms from !vocabulary.',array('@number'=>$state->deleted,'!vocabulary'=>$vocabulary->name)));