From 2667ad366ce397c2ab99eafdfa12ab1f4a4d4532 Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Wed, 18 Apr 2018 00:13:32 +0200 Subject: [PATCH] Show correct importer context objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs #9584 - object by reference 🎡 - we modify the object later on - this has resulted in a wrong context output in the admin client - e.g. we've output an updated user reference --- core/server/data/importer/importers/data/base.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/server/data/importer/importers/data/base.js b/core/server/data/importer/importers/data/base.js index 35623170db..d93aea147b 100644 --- a/core/server/data/importer/importers/data/base.js +++ b/core/server/data/importer/importers/data/base.js @@ -199,7 +199,7 @@ class Base { // CASE: you import null, fallback to owner if (!obj[key]) { if (!userReferenceProblems[obj.id]) { - userReferenceProblems[obj.id] = {obj: obj, keys: []}; + userReferenceProblems[obj.id] = {obj: _.cloneDeep(obj), keys: []}; } userReferenceProblems[obj.id].keys.push(key); @@ -217,7 +217,7 @@ class Base { // CASE: fallback to owner if (!existingUser) { if (!userReferenceProblems[obj.id]) { - userReferenceProblems[obj.id] = {obj: obj, keys: []}; + userReferenceProblems[obj.id] = {obj: _.cloneDeep(obj), keys: []}; } userReferenceProblems[obj.id].keys.push(key); @@ -264,7 +264,7 @@ class Base { if (!existingUser) { if (!userReferenceProblems[obj.id]) { - userReferenceProblems[obj.id] = {obj: obj, keys: []}; + userReferenceProblems[obj.id] = {obj: _.cloneDeep(obj), keys: []}; } userReferenceProblems[obj.id].keys.push(key);