diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 77cce41c25527dd4868aaa87293b0b8a2a1bb287..5cdf3c3665ba826b4dea2b4432c23fb3fed71d39 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,8 @@ Feeds 6.x 1.0 xxxxx xx, 2010-xx-xx ---------------------------------- +- #718460 jerdavis: In FeedsNodeProcessor, clear items only for the current + importer id. - #718474 jerdavis: In FeedsNodeProcessor, check for duplicate items within same importer id. diff --git a/plugins/FeedsNodeProcessor.inc b/plugins/FeedsNodeProcessor.inc index 24ea7c7e682b58b0b990a8ae26ab07f64249bb26..af85296b05eb6aa82709339a43faa3450a1619b2 100644 --- a/plugins/FeedsNodeProcessor.inc +++ b/plugins/FeedsNodeProcessor.inc @@ -98,14 +98,14 @@ class FeedsNodeProcessor extends FeedsProcessor { */ public function clear(FeedsBatch $batch, FeedsSource $source) { if (empty($batch->total)) { - $batch->total = db_result(db_query("SELECT COUNT(nid) FROM {feeds_node_item} WHERE feed_nid = %d", $source->feed_nid)); + $batch->total = db_result(db_query('SELECT COUNT(nid) FROM {feeds_node_item} WHERE id = "%s" AND feed_nid = %d', $source->id, $source->feed_nid)); } - $result = db_query_range('SELECT nid FROM {feeds_node_item} WHERE feed_nid = %d', $source->feed_nid, 0, variable_get('feeds_node_batch_size', FEEDS_NODE_BATCH_SIZE)); + $result = db_query_range('SELECT nid FROM {feeds_node_item} WHERE id = "%s" AND feed_nid = %d ', $source->id, $source->feed_nid, 0, variable_get('feeds_node_batch_size', FEEDS_NODE_BATCH_SIZE)); while ($node = db_fetch_object($result)) { _feeds_node_delete($node->nid); $batch->deleted++; } - if (db_result(db_query_range('SELECT nid FROM {feeds_node_item} WHERE feed_nid = %d', $source->feed_nid, 0, 1))) { + if (db_result(db_query_range('SELECT nid FROM {feeds_node_item} WHERE id = "%s" AND feed_nid = %d', $source->id, $source->feed_nid, 0, 1))) { return (1.0 / ($batch->total + 1)) * $batch->deleted; }