Index: feeds.plugins.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/feeds.plugins.inc,v
retrieving revision 1.6
diff -u -p -r1.6 feeds.plugins.inc
--- feeds.plugins.inc 10 Jul 2010 22:43:05 -0000 1.6
+++ feeds.plugins.inc 20 Oct 2010 03:44:34 -0000
@@ -141,17 +141,6 @@ function _feeds_feeds_plugins() {
'path' => $path,
),
);
- $info['FeedsFeedNodeProcessor'] = array(
- 'name' => 'Feed Node processor',
- 'description' => 'Create Feed nodes.',
- 'help' => 'Create Feed nodes from parsed content. Feed nodes are nodes that can import feeds themselves. This can be useful for instance when importing OPML feeds.',
- 'handler' => array(
- 'parent' => 'FeedsProcessor',
- 'class' => 'FeedsFeedNodeProcessor',
- 'file' => 'FeedsFeedNodeProcessor.inc',
- 'path' => $path,
- ),
- );
$info['FeedsUserProcessor'] = array(
'name' => 'User processor',
'description' => 'Create users.',
Index: feeds_news/feeds_news.feeds_importer_default.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/feeds_news/feeds_news.feeds_importer_default.inc,v
retrieving revision 1.1
diff -u -p -r1.1 feeds_news.feeds_importer_default.inc
--- feeds_news/feeds_news.feeds_importer_default.inc 27 Jul 2010 23:01:25 -0000 1.1
+++ feeds_news/feeds_news.feeds_importer_default.inc 20 Oct 2010 03:44:34 -0000
@@ -87,10 +87,11 @@ function feeds_news_feeds_importer_defau
'config' => array(),
),
'processor' => array(
- 'plugin_key' => 'FeedsFeedNodeProcessor',
+ 'plugin_key' => 'FeedsNodeProcessor',
'config' => array(
'content_type' => 'feed',
'update_existing' => 0,
+ 'expire' => '-1',
'mappings' => array(
'0' => array(
'source' => 'title',
@@ -99,7 +100,7 @@ function feeds_news_feeds_importer_defau
),
'1' => array(
'source' => 'xmlurl',
- 'target' => 'source',
+ 'target' => 'feeds_source',
'unique' => 1,
),
),
Index: feeds_news/feeds_news.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/feeds_news/feeds_news.test,v
retrieving revision 1.2
diff -u -p -r1.2 feeds_news.test
--- feeds_news/feeds_news.test 15 Sep 2010 19:27:42 -0000 1.2
+++ feeds_news/feeds_news.test 20 Oct 2010 03:44:34 -0000
@@ -136,7 +136,7 @@ class FeedsExamplesOPMLTestCase extends
// Import OPML and assert.
$file = $this->generateOPML();
$this->importFile('opml', $file);
- $this->assertText('Created 3 feed nodes.');
+ $this->assertText('Created 3 Feed nodes.');
$count = db_result(db_query("SELECT COUNT(*) FROM {feeds_source}"));
$this->assertEqual($count, 4, 'Found correct number of items.');
Index: feeds_ui/tests/feeds_ui.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/feeds_ui/tests/feeds_ui.test,v
retrieving revision 1.7
diff -u -p -r1.7 feeds_ui.test
--- feeds_ui/tests/feeds_ui.test 15 Sep 2010 19:27:42 -0000 1.7
+++ feeds_ui/tests/feeds_ui.test 20 Oct 2010 03:44:34 -0000
@@ -89,12 +89,12 @@ class FeedsUIUserInterfaceTestCase exten
$this->clickLink('Change', 2);
$this->assertText('Select a processor');
$edit = array(
- 'plugin_key' => 'FeedsFeedNodeProcessor',
+ 'plugin_key' => 'FeedsTermProcessor',
);
$this->drupalPost('admin/build/feeds/edit/test_feed/processor', $edit, 'Save');
// Assert changed configuration.
- $this->assertPlugins('test_feed', 'FeedsFileFetcher', 'FeedsCSVParser', 'FeedsFeedNodeProcessor');
+ $this->assertPlugins('test_feed', 'FeedsFileFetcher', 'FeedsCSVParser', 'FeedsTermProcessor');
// Delete feed.
$this->drupalPost('admin/build/feeds/delete/test_feed', array(), 'Delete');
@@ -136,4 +136,4 @@ class FeedsUIUserInterfaceTestCase exten
// @todo Refreshing/deleting feed items. Needs to live in feeds.test
}
-}
\ No newline at end of file
+}
Index: plugins/FeedsNodeProcessor.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/plugins/FeedsNodeProcessor.inc,v
retrieving revision 1.51.2.1
diff -u -p -r1.51.2.1 FeedsNodeProcessor.inc
--- plugins/FeedsNodeProcessor.inc 17 Sep 2010 13:46:30 -0000 1.51.2.1
+++ plugins/FeedsNodeProcessor.inc 20 Oct 2010 03:44:34 -0000
@@ -244,6 +244,15 @@ class FeedsNodeProcessor extends FeedsPr
elseif (in_array($target_element, array('title', 'status', 'created', 'nid', 'uid'))) {
$target_node->$target_element = $value;
}
+ elseif ($target_element == 'feeds_source') {
+ if ($id = feeds_get_importer_id($this->config['content_type'])) {
+ $class = get_class(feeds_importer($id)->fetcher);
+ $target_node->feeds[$class]['source'] = $value;
+ // This effectively suppresses 'import on submission' feature.
+ // See feeds_node_insert().
+ $target_node->feeds['suppress_import'] = TRUE;
+ }
+ }
}
/**
@@ -294,6 +303,15 @@ class FeedsNodeProcessor extends FeedsPr
'optional_unique' => TRUE,
),
);
+ // If the target content type is a Feed node, expose its source field.
+ if ($id = feeds_get_importer_id($this->config['content_type'])) {
+ $name = feeds_importer($id)->config['name'];
+ $targets['feeds_source'] = array(
+ 'name' => t('Feed source'),
+ 'description' => t('The content type created by this processor is a Feed Node, it represents a source itself. Depending on the fetcher selected on the importer "@importer", this field is expected to be for example a URL or a path to a file.', array('@importer' => $name)),
+ 'optional_unique' => TRUE,
+ );
+ }
// Let other modules expose mapping targets.
self::loadMappers();