Show correct importer context objects

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
This commit is contained in:
kirrg001 2018-04-18 00:13:32 +02:00
parent f9ffc395c0
commit 2667ad366c

View File

@ -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);