| Project: | Feeds |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
Is there a reason nodes created by FeedsFeedNodeProcessor are different from nodes created by FeedNodeProcessor?
For example, nodes created by FeedsFeedNodeProcessor are *not* stored in the feeds_node_item table, while nodes created by FeedNodeProcessor are.
However, the only difference between the two is that the first one creates feed nodes while the latter creates simple nodes. Wouldn't it make more sense then if FeedsFeedNodeProcessor subclasses from FeedNodeProcessor (as it is a special case). This way, the FeedsFeedNodeProcessor also has the nice functionality that it is stored as an item. This in turn can be harvested by views to inspect relationships like OPML Feed -> RSS Feed -> Item. In the current implementation, I do not understand how to get from Item back to OPML Feed because of the missing parent-child relationship between OPML Feed and RSS Feed.
I already started introducing that functionality in the FeedsMultiFeedNodeProcessor (http://github.com/pvhee/feeds_multifeeds/) and could turn it into a patch if wanted.
Comments
#1
I've coded this idea together in the feeds_multifeeds module: http://github.com/pvhee/feeds_multifeeds/
This is the situation:
Ideally, the FeedsMultiFeedNodeProcessor would replace the FeedsFeedNodeProcessor (of course, keeping the name FeedsFeedNodeProcessor). I could turn this into a patch for that file if you wish. I'd love to hear what you think about this.
#2
FeedsFeedNodeProcessor is rather old and could be probably replaced altogether by FeedsNodeProcessor.
Have you tried to patch FeedNodeProcessor with an additional mapping target for the feed URL? Wouldn't that be the most direct way of getting rid of FeedsFeedNodeProcessor altogether?
#3
I now subclassed it to not interfere too much with FeedNodeProcessor but indeed patching it would be sufficient. The extra functionality can easily be integrated there. I'll roll out a patch with some tests as soon as possible.
#4
In attachment a patch that makes FeedsFeedNodeProcessor subclass from FeedNodeProcessor instead of FeedsProcessor.
It contains a unit test that imports an OPML listing two RSS feeds. The RSS feeds at their turn will import nodes as well.
I considered integrating this directly in FeedNodeProcessor but some settings are rather specific, e.g. the content type you import into should have an attached importer configuration, deleting the nodes might be unwanted (as you could start a cascade of deletions), etc.
The patch solves the problems outlined in #0, e.g. now nodes imported using this processor follow the same logic as the ones imported using FeedsNodeProcessor.
#5
Awesome, I need to review...
#6
The patch doesn't apply anymore. Sorry, this was partly my fault as I was completely backed up with other work until recently. Would appreciate a re-roll.
#7
No problem! I've rerolled the patch.
#8
This patch applied, I get 148 passes, 145 fails, and 0 exceptions:
http://skitch.com/alexbarth/dd3y3/test-result-feeds
#9
I've been trying this patch and ran into the following superficial problems:
* feeds.plugins.inc: Should modify FeedsFeedNodeProcessor entry to
'parent' => 'FeedsNodeProcessor'.* After patching, the PHP parser chokes on FeedsFeedNodeProcessor.inc because
FeedsNodeProcessorclass is not found (maybe due to CTools caching the plugin definitions). I just added the linerequire_once(drupal_get_path('module', 'feeds') . '/plugins/FeedsNodeProcessor.inc');to FeedsFeedNodeProcessor.inc, cleared the cache, then removed the line again.Other than that, this patch seems to work fine. I'll submit an updated patch once I try the tests.
#10
Just for reference, here is the updated patch against today's dev.
If anyone has a fix for the
require_onceworkaround above, please say so.#11
That is strange as this class should be found exactly because it is declared as parent in the plugin definition. Can you make sure you cleared all caches with drush cc all or equivalent? I wonder whether there was a change to CTools plugin.inc, but I doubt it, because otherwise not even "FeedsProcessor" or "FeedsPlugin" parent classes would be found.
#12
Renaming for making this issue easier to find - I've at times been looking for it and couldn't dig it up :-)
#13
Indeed, I never had the problem with the patch of #7, the class was found because it is the parent.
#14
One really great thing this patch makes possible is to take an XML file of FeedAPI information generated with Views and import it as Feeds sources, giving you another migration option instead of http://github.com/developmentseed/feedapi2feeds.
#15
After having finally time to revisit this issue, I think we should actually remove FeedsFeedNodeProcessor. This will require 25 lines of code in FeedsNodeProcessor and get rid of 226 lines of stale FeedsFeedNodeProcessor code.
See patch attached.
#16
Ha, sorry.
#17
- Forgot to remove FeedsFeedNodeProcessor from plugin definition. Fixed.
- Fixed a small but fatal typo where a variable was not initialized.
#18
- Fixed another small typo that was causing FeedsNodeProcessor to not find the correct content type setting.
#19
All tests passing now. I am going to commit this soon-ish.
#20
#18 is committed now. Needs porting to 6.x
http://drupal.org/cvs?commit=431452
#21
Tests pass, (not counting ones that didn't beforehand).
#22
No further discussion here?
and no patch will be ported?
#23
The last submitted patch, 728534-1-port_remove_feeds_feed_node.patch, failed testing.
#24
All tests failed!
Actually I tried to patch http://drupal.org/node/728534#comment-3257292 manually, to 6.x.1.0 version but there is a mismatch.
Also, there is no 6.X.Dev version available and it looks D6 branch is abandoned!
#25
@Ayesh: Patches should be created against the 6.x-1.x branch from a Git repository clone.