I checked in the source code (did not test) that this applies to alpha12 too.

Steps to reproduce:

1. Create two different Feed type, both importing nodes, use single form (no Feed nodes).
2. Import from both.
3. Go to /import/blah/delete-items
4. Delete
5. Watch the other feed get cleared too.

Problem seems to be in FeedsNodeProcessor::clear:

  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));
    }
    $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));
    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))) {
      return (1.0 / ($batch->total + 1)) * $batch->deleted;
    }

Only feed_nid is used for selection where both feed_nid and id should be used. The following code is UNTESTED (hence, no patch file):

  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 AND id='%s'", $source->feed_nid, $this->id));
    }
    $result = db_query_range("SELECT nid FROM {feeds_node_item} WHERE feed_nid = %d AND id='%s'", $source->feed_nid, $this->id, 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 AND id='%s'", $source->feed_nid, $this->id, 0, 1))) {
      return (1.0 / ($batch->total + 1)) * $batch->deleted;
    }

Comments

alex_b’s picture

Version: 6.x-1.0-alpha9 » 6.x-1.0-alpha12
Status: Active » Fixed

This is fixed as of alpha 12.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.