Skip to content
Snippets Groups Projects
Commit 1a218359 authored by Chris Leppanen's avatar Chris Leppanen
Browse files

Always set is_new on node create rather than node_save().

parent 00ffe9e1
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
$node->changed = REQUEST_TIME;
$node->created = REQUEST_TIME;
$node->language = LANGUAGE_NONE;
$node->is_new = TRUE;
node_object_prepare($node);
// Populate properties that are set by node_object_prepare().
$node->log = 'Created by FeedsNodeProcessor';
......@@ -112,10 +113,6 @@ class FeedsNodeProcessor extends FeedsProcessor {
* Save a node.
*/
public function entitySave($entity) {
// If nid is set and a node with that id doesn't exist, flag as new.
if (!empty($entity->nid) && !node_load($entity->nid)) {
$entity->is_new = TRUE;
}
node_save($entity);
}
......
......@@ -137,8 +137,6 @@ abstract class FeedsProcessor extends FeedsPlugin {
*/
public function process(FeedsSource $source, FeedsParserResult $parser_result) {
$state = $source->state(FEEDS_PROCESS);
$entity_info = $this->entityInfo();
$id_key = $entity_info['entity keys']['id'];
while ($item = $parser_result->shiftItem()) {
......@@ -163,8 +161,6 @@ abstract class FeedsProcessor extends FeedsPlugin {
try {
$replace_existing = $this->config['update_existing'] == FEEDS_REPLACE_EXISTING;
// Load an existing entity.
if ($entity_id) {
$entity = $this->entityLoad($source, $entity_id);
......
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