Index: plugins/FeedsDataProcessor.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/feeds/plugins/Attic/FeedsDataProcessor.inc,v retrieving revision 1.24.2.2 diff -u -p -r1.24.2.2 FeedsDataProcessor.inc --- plugins/FeedsDataProcessor.inc 28 Oct 2010 19:58:22 -0000 1.24.2.2 +++ plugins/FeedsDataProcessor.inc 29 Oct 2010 17:54:33 -0000 @@ -260,7 +260,7 @@ class FeedsDataProcessor extends FeedsPr $form['delete_with_source'] = array( '#type' => 'checkbox', '#title' => t('Delete items with source'), - '#description' => t('If enabled, any feed items associated with a source node will removed along with the node. Not available for standalone importers.'), + '#description' => t('If enabled, any feed items associated with a source node will be removed along with the node. Not available for standalone importers.'), '#default_value' => $this->config['delete_with_source'], '#disabled' => empty(feeds_importer($this->id)->config['content_type']) ? TRUE : FALSE, ); Index: plugins/FeedsNodeProcessor.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/feeds/plugins/FeedsNodeProcessor.inc,v retrieving revision 1.51.2.2 diff -u -p -r1.51.2.2 FeedsNodeProcessor.inc --- plugins/FeedsNodeProcessor.inc 25 Oct 2010 22:43:03 -0000 1.51.2.2 +++ plugins/FeedsNodeProcessor.inc 29 Oct 2010 17:54:33 -0000 @@ -150,6 +150,7 @@ class FeedsNodeProcessor extends FeedsPr 'expire' => FEEDS_EXPIRE_NEVER, 'mappings' => array(), 'author' => 0, + 'delete_with_source' => FALSE, ); } @@ -205,6 +206,13 @@ class FeedsNodeProcessor extends FeedsPr ), '#default_value' => $this->config['update_existing'], ); + $form['delete_with_source'] = array( + '#type' => 'checkbox', + '#title' => t('Delete items with source'), + '#description' => t('If enabled, any feed items associated with a source node will be removed along with the node. Not available for standalone importers.'), + '#default_value' => $this->config['delete_with_source'], + '#disabled' => empty(feeds_importer($this->id)->config['content_type']) ? TRUE : FALSE, + ); return $form; } Index: tests/feeds_processor_node.test =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/feeds/tests/feeds_processor_node.test,v retrieving revision 1.2 diff -u -p -r1.2 feeds_processor_node.test --- tests/feeds_processor_node.test 15 Sep 2010 19:27:42 -0000 1.2 +++ tests/feeds_processor_node.test 29 Oct 2010 17:54:33 -0000 @@ -262,6 +262,28 @@ class FeedsRSStoNodesTest extends FeedsW // Remove all items again so that next test can check for them. $this->drupalPost('node/'. $nid .'/delete-items', array(), 'Delete'); + // Test 'Delete items with source' setting. + $this->setSettings('syndication', 'FeedsNodeProcessor', array('delete_with_source' => 1)); + // Use many_items.rss2 to force batch + $feed_url = $GLOBALS['base_url'] .'/'. drupal_get_path('module', 'feeds') .'/tests/feeds/many_items.rss2'; + $nid = $this->createFeedNode('syndication', $feed_url); + $this->assertText('Page Drupal 6 has been created.'); + $this->assertText('Created 150 Story nodes.'); + + // Assert DB status. + $count = db_result(db_query("SELECT COUNT(*) FROM {node} n INNER JOIN {feeds_node_item} fn ON n.nid = fn.nid")); + $this->assertEqual($count, 150, 'Accurate number of items in database.'); + + // All feed items should get deleted. + $this->drupalPost('node/'. $nid .'/delete', array(), 'Delete'); + // Don't test for 'Page Drupal 6 has been deleted.' since we get redirected + // to the front page. + $this->assertText('Deleted 150 nodes.'); + + // Assert DB status. + $count = db_result(db_query("SELECT COUNT(*) FROM {node} n INNER JOIN {feeds_node_item} fn ON n.nid = fn.nid")); + $this->assertEqual($count, 0, 'Accurate number of items in database.'); + // Create an importer, not attached to content type. $this->createImporterConfiguration('Syndication standalone', 'syndication_standalone'); $edit = array(