I was tempted to put this in #624088: Mapper: ImageField/FileField (formalize feed elements), but since it is committed I created a new issue.
I was previously using #19 from that issue, and I moved today to start using the committed version from HEAD with the batch patch from #600584: Use Batch API. I'm now getting this:
[Fri Jan 15 22:08:11 2010] [error] [client 1.2.3.4] PHP Fatal error: Class 'FeedsEnclosure' not found in /mypath/sites/all/modules/feeds/mappers/filefield.inc on line 56, referer: http://mysite.com/batch?op=start&id=80
My feed is attached to a content type called feed, refresh never, import on create. Fetcher is file upload, parser is a custom XML parser I wrote based on the OPML parser, and my processor is the node processor. The above message appears when I am on a node of type feed and click on "import" to start the batch processing.
It looks like the class FeedsEnclosure was added in #28. I'm not quite sure yet why it is breaking. I'll report back if I figure it out, but perhaps someone else has a thought. Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 686462-4_move_feeds_enclosure.patch | 5.34 KB | alex_b |
Comments
Comment #1
rjbrown99 commentedOk, so I copied the entire FeedsEnclosure class into my custom XML parser, and now I'm in business. I guess this is my error.
Is it possible to locate FeedsEnclosure somewhere that it can be found when using your own parser?
Comment #2
rjbrown99 commentedComment #3
rjbrown99 commentedHm, well maybe that isn't the ideal approach. Now I get this when switching back to the syndication parser -
Any suggestions? If FeedsEnclosure is a valuable class to supporting modules, would it be better to locate it somewhere that all of the parsers could have access to?
Comment #4
alex_b commentedThe FeedsEnclosure class is defined in FeedsSyndicationParser with the assumption that only Syndication parsers would use the enclosure element. FeedsSimplePieParser uses a trick to include the file - see how the plugin declaration in feeds.plugins.inc specifies FeedsSyndicationParser as parent while it is actually derived from FeedsParser?
What we *should* do is this: simplify. Let's move FeedsEnclosure to FeedsParser and we don't need to do confusing tricks that trip up developers. Also, in the meantime FeedsDateTimeElement has been committed to FeedsParser.inc. It is only consistent to also capture FeedsEnclosure there.
Patch (untested) attached.
Comment #5
arski commentedBrilliant! I just mentioned this issue in #624088 and it works perfectly now. I was trying to create some nodes by importing a .cvs file with image fields.
Thanks!
Comment #6
alex_b commentedLet's get this patch into the next release.
Comment #7
alex_b commentedCommitted to HEAD.