? 850638-1_preview.patch ? libraries/simplepie.inc Index: feeds.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/feeds/feeds.module,v retrieving revision 1.47 diff -u -p -r1.47 feeds.module --- feeds.module 19 Jun 2010 20:34:31 -0000 1.47 +++ feeds.module 11 Jul 2010 01:05:44 -0000 @@ -271,10 +271,7 @@ function feeds_nodeapi(&$node, $op, $for if (trim($node->title) == '') { try { $source->addConfig($node_feeds); - // @todo Too many indirections. Clean up. - $batch = $source->importer->fetcher->fetch($source); - $source->importer->parser->parse($batch, $source); - if (!$last_title = $batch->getTitle()) { + if (!$last_title = $source->preview()->getTitle()) { throw new Exception(); } } Index: includes/FeedsSource.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/feeds/includes/FeedsSource.inc,v retrieving revision 1.13 diff -u -p -r1.13 FeedsSource.inc --- includes/FeedsSource.inc 19 Jun 2010 19:40:43 -0000 1.13 +++ includes/FeedsSource.inc 11 Jul 2010 01:05:44 -0000 @@ -111,6 +111,21 @@ class FeedsSource extends FeedsConfigura } /** + * Preview = fetch and parse a feed. + * + * @return + * FeedsImportBatch object, fetched and parsed. + * + * @throws + * Throws Exception if an error occurs when fetching or parsing. + */ + public function preview() { + $batch = $this->importer->fetcher->fetch($this); + $this->importer->parser->parse($batch, $this); + return $batch; + } + + /** * Import a feed: execute, fetching, parsing and processing stage. * * Lock a source before importing by using FeedsSource::lock(), after