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

Fix node nid result 0 not being handled properly.

Fix feed item node's body not being populated.
parent 9e415bb3
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -22,7 +22,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
foreach ($parserResult->value['items'] as $item) { foreach ($parserResult->value['items'] as $item) {
// If the target item does not exist OR if update_existing is enabled, // If the target item does not exist OR if update_existing is enabled,
// map and save. // map and save.
if (!$nid = $this->existingItemId($item, $source) || $this->config['update_existing']) { if (!($nid = $this->existingItemId($item, $source)) || $this->config['update_existing']) {
// Map item to a node. // Map item to a node.
$node = $this->map($item); $node = $this->map($item);
...@@ -149,7 +149,7 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -149,7 +149,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
), ),
'1' => array( '1' => array(
'source' => 'description', 'source' => 'description',
'target' => 'teaser', 'target' => 'body',
'unique' => FALSE, 'unique' => FALSE,
), ),
'2' => array( '2' => array(
...@@ -208,7 +208,11 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -208,7 +208,11 @@ class FeedsNodeProcessor extends FeedsProcessor {
if (in_array($target_element, array('url', 'guid'))) { if (in_array($target_element, array('url', 'guid'))) {
$target_node->feeds_node_item->$target_element = $value; $target_node->feeds_node_item->$target_element = $value;
} }
elseif (in_array($target_element, array('title', 'teaser', 'status', 'created'))) { elseif ($target_element == 'body') {
$target_node->teaser = $value;
$target_node->body = $value;
}
elseif (in_array($target_element, array('title', 'status', 'created'))) {
$target_node->$target_element = $value; $target_node->$target_element = $value;
} }
} }
...@@ -228,7 +232,7 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -228,7 +232,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
'name' => t('Published date'), 'name' => t('Published date'),
), ),
// Using 'teaser' instead of 'body' forces entire content above the break. // Using 'teaser' instead of 'body' forces entire content above the break.
'teaser' => array( 'body' => array(
'name' => t('Body'), 'name' => t('Body'),
), ),
'url' => array( 'url' => array(
......
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