Feeds 6.x 1.X XXXX
------------------
+- #850638 alex_b: Introduce FeedsSource::preview().
- #850298 alex_b: ParserCSV: Support batching (only affects library, full parser
level batch support to be added later with #744660).
- Minor cleanup of admin UI language and CSS.
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();
}
}
}
/**
+ * 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