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.
Comment | File | Size | Author |
---|---|---|---|
#21 | 728534-1-port_remove_feeds_feed_node.patch | 5.95 KB | twistor |
#18 | 728534-18_remove_feeds_feed_node.patch | 13.34 KB | alex_b |
#17 | 728534-17_remove_feeds_feed_node.patch | 13.31 KB | alex_b |
#15 | 728534-15_remove_feeds_feed_node.patch | 12.23 KB | alex_b |
#10 | 728534_10_feedsfeed.patch | 12.38 KB | infojunkie |
Comments
Comment #1
pvhee CreditAttribution: pvhee commentedI'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.
Comment #2
alex_b CreditAttribution: alex_b commentedFeedsFeedNodeProcessor 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?
Comment #3
pvhee CreditAttribution: pvhee commentedI 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.
Comment #4
pvhee CreditAttribution: pvhee commentedIn 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.
Comment #5
alex_b CreditAttribution: alex_b commentedAwesome, I need to review...
Comment #6
alex_b CreditAttribution: alex_b commentedThe 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.
Comment #7
pvhee CreditAttribution: pvhee commentedNo problem! I've rerolled the patch.
Comment #8
alex_b CreditAttribution: alex_b commentedThis patch applied, I get 148 passes, 145 fails, and 0 exceptions:
http://skitch.com/alexbarth/dd3y3/test-result-feeds
Comment #9
infojunkieI'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
FeedsNodeProcessor
class 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.
Comment #10
infojunkieJust for reference, here is the updated patch against today's dev.
If anyone has a fix for the
require_once
workaround above, please say so.Comment #11
alex_b CreditAttribution: alex_b commentedThat 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.
Comment #12
alex_b CreditAttribution: alex_b commentedRenaming for making this issue easier to find - I've at times been looking for it and couldn't dig it up :-)
Comment #13
pvhee CreditAttribution: pvhee commentedIndeed, I never had the problem with the patch of #7, the class was found because it is the parent.
Comment #14
gcassie CreditAttribution: gcassie commentedOne 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.
Comment #15
alex_b CreditAttribution: alex_b commentedAfter 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.
Comment #16
alex_b CreditAttribution: alex_b commentedHa, sorry.
Comment #17
alex_b CreditAttribution: alex_b commented- Forgot to remove FeedsFeedNodeProcessor from plugin definition. Fixed.
- Fixed a small but fatal typo where a variable was not initialized.
Comment #18
alex_b CreditAttribution: alex_b commented- Fixed another small typo that was causing FeedsNodeProcessor to not find the correct content type setting.
Comment #19
alex_b CreditAttribution: alex_b commentedAll tests passing now. I am going to commit this soon-ish.
Comment #20
alex_b CreditAttribution: alex_b commented#18 is committed now. Needs porting to 6.x
http://drupal.org/cvs?commit=431452
Comment #21
twistor CreditAttribution: twistor commentedTests pass, (not counting ones that didn't beforehand).
Comment #22
Ayesh CreditAttribution: Ayesh commentedNo further discussion here?
and no patch will be ported?
Comment #24
Ayesh CreditAttribution: Ayesh commentedAll 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!
Comment #25
Dave Reid@Ayesh: Patches should be created against the 6.x-1.x branch from a Git repository clone.
Comment #26
twistor CreditAttribution: twistor as a volunteer commented