Skip to content
Snippets Groups Projects
Commit 5c70b995 authored by Alex Barth's avatar Alex Barth
Browse files

#663830 Aron Novak, alex_b: When download of URL failed, node w/ empty title is created.

parent a613c5bc
No related branches found
No related tags found
No related merge requests found
...@@ -250,18 +250,16 @@ function feeds_nodeapi(&$node, $op, $form) { ...@@ -250,18 +250,16 @@ function feeds_nodeapi(&$node, $op, $form) {
// @todo Too many indirections. Clean up. // @todo Too many indirections. Clean up.
$batch = $source->importer->fetcher->fetch($source); $batch = $source->importer->fetcher->fetch($source);
$source->importer->parser->parse($batch, $source); $source->importer->parser->parse($batch, $source);
if (!$batch->getTitle()) { // Keep the title in a static cache and populate $node->title on
form_set_error('title', t('Could not retrieve title from feed.'), 'error'); // 'presave' as node module looses any changes to $node after
} // 'validate'.
else { if (!$last_title = $batch->getTitle()) {
// Keep the title in a static cache and populate $node->title on throw new Exception();
// 'presave' as node module looses any changes to $node after
// 'validate'.
$last_title = $batch->getTitle();
} }
} }
catch (Exception $e) { catch (Exception $e) {
drupal_set_message($e->getMessage(), 'error'); drupal_set_message($e->getMessage(), 'error');
form_set_error('title', t('Could not retrieve title from feed.'), 'error');
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment