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

#755544 Monkey Master: Keep batch processing when mapping fails.

parent 40a8b894
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
Feeds 6.x 1.0 xxxxxxxxxxxxxxxxxxxx Feeds 6.x 1.0 xxxxxxxxxxxxxxxxxxxx
---------------------------------- ----------------------------------
- #755544 Monkey Master: Keep batch processing when mapping fails.
- alex_b: Reset import schedule after deleting items from feed. - alex_b: Reset import schedule after deleting items from feed.
- #653412 rbrandon: Do not create items older than expiry time. - #653412 rbrandon: Do not create items older than expiry time.
- #725392 nicholasThompson: FeedsBatch does not check feeds folder exists before - #725392 nicholasThompson: FeedsBatch does not check feeds folder exists before
......
...@@ -41,10 +41,6 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -41,10 +41,6 @@ class FeedsNodeProcessor extends FeedsProcessor {
// If updating populate nid and vid avoiding an expensive node_load(). // If updating populate nid and vid avoiding an expensive node_load().
$node->nid = $nid; $node->nid = $nid;
$node->vid = db_result(db_query("SELECT vid FROM {node} WHERE nid = %d", $nid)); $node->vid = db_result(db_query("SELECT vid FROM {node} WHERE nid = %d", $nid));
$batch->updated++;
}
else {
$batch->created++;
} }
// Populate and prepare node object. // Populate and prepare node object.
...@@ -66,11 +62,21 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -66,11 +62,21 @@ class FeedsNodeProcessor extends FeedsProcessor {
$node->log = 'Created/updated by FeedsNodeProcessor'; $node->log = 'Created/updated by FeedsNodeProcessor';
$node->uid = 0; $node->uid = 0;
// Execute mappings from $item to $node. // Map and save nodes. If errors occur don't stop but report them.
$this->map($item, $node); try {
$this->map($item, $node);
// Save the node. node_save($node);
node_save($node); if (!empty($nid)) {
$batch->updated++;
}
else {
$batch->created++;
}
}
catch (Exception $e) {
drupal_set_message($e->getMessage(), 'warning');
watchdog('feeds', $e->getMessage(), array(), WATCHDOG_WARNING);
}
} }
$processed++; $processed++;
......
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