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

#897258 TrevorBradley, alex_b: Mapping target nid.

parent d8b9d19e
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
Feeds 6.x 1.0 XXXXXXXXXXXXXXXXXX
--------------------------------
- #897258 TrevorBradley, alex_b: Mapping target nid.
- #873198 BWPanda, morningtime: Import multiple values to tag vocabulary.
- #872772 andrewlevine: Fix buildNode() (and node_load()) called unnecessarily.
- #873240 thsutton: Use isset() to avoid notices.
......
......@@ -239,7 +239,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
$target_node->teaser = node_teaser($value);
$target_node->body = $value;
}
elseif (in_array($target_element, array('title', 'status', 'created'))) {
elseif (in_array($target_element, array('title', 'status', 'created', 'nid'))) {
$target_node->$target_element = $value;
}
}
......@@ -264,6 +264,11 @@ class FeedsNodeProcessor extends FeedsProcessor {
);
}
$targets += array(
'nid' => array(
'name' => t('Node ID'),
'description' => t('The nid of the node. NOTE: use this feature with care, node ids are usually assigned by Drupal.'),
'optional_unique' => TRUE,
),
'uid' => array(
'name' => t('User ID'),
'description' => t('The Drupal user ID of the node author.'),
......@@ -304,6 +309,9 @@ class FeedsNodeProcessor extends FeedsProcessor {
// exist in the database.
foreach ($this->uniqueTargets($source_item) as $target => $value) {
switch ($target) {
case 'nid':
$nid = db_result(db_query("SELECT nid FROM {node} WHERE nid = %d", $value));
break;
case 'url':
$nid = db_result(db_query("SELECT nid FROM {feeds_node_item} WHERE feed_nid = %d AND id = '%s' AND url = '%s'", $source->feed_nid, $source->id, $value));
break;
......
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