Skip to content

Commit

Permalink
Show correct importer context objects
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kirrg001 committed Apr 17, 2018
1 parent f9ffc39 commit 2667ad3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/server/data/importer/importers/data/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2667ad3

Please sign in to comment.