From 00ffe9e1367208ddb85ca487b2306bfbca098888 Mon Sep 17 00:00:00 2001
From: Chris Leppanen <chris.leppanen@gmail.com>
Date: Fri, 16 Nov 2012 16:23:34 -0800
Subject: [PATCH] Re-fix replace existing behavior.

---
 plugins/FeedsProcessor.inc | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/plugins/FeedsProcessor.inc b/plugins/FeedsProcessor.inc
index d37555d7..903fe123 100755
--- a/plugins/FeedsProcessor.inc
+++ b/plugins/FeedsProcessor.inc
@@ -165,14 +165,8 @@ abstract class FeedsProcessor extends FeedsPlugin {
 
         $replace_existing = $this->config['update_existing'] == FEEDS_REPLACE_EXISTING;
 
-        // Build a new entity.
-        if (!$entity_id || $replace_existing) {
-          $entity = $this->newEntity($source);
-          $this->newItemInfo($entity, $source->feed_nid, $hash);
-        }
-
         // Load an existing entity.
-        else {
+        if ($entity_id) {
           $entity = $this->entityLoad($source, $entity_id);
 
           // The feeds_item table is always updated with the info for the most
@@ -181,9 +175,10 @@ abstract class FeedsProcessor extends FeedsPlugin {
           $entity->feeds_item->entity_id = $entity_id;
         }
 
-        if ($entity_id && $replace_existing) {
-          $entity->is_new = FALSE;
-          $entity->$id_key = $entity_id;
+        // Build a new entity.
+        else {
+          $entity = $this->newEntity($source);
+          $this->newItemInfo($entity, $source->feed_nid, $hash);
         }
 
         // Set property and field values.
-- 
GitLab