From 6bc658be9bd0a4c2b2222e19bd999a902888852e Mon Sep 17 00:00:00 2001 From: Dilan Guneratne Date: Mon, 3 Dec 2018 11:48:03 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BRemoved=20user=20reference=20warnin?= =?UTF-8?q?g=20from=20importer=20report=20if=20post=20is=20a=20draft=20(#1?= =?UTF-8?q?0169)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs #9584 - The Importer checks if a user reference is null. But if the post is a draft and published_by is null, we should ignore the user reference detection. - This change will avoid showing an incorrect user reference warning in the importer report for draft posts. --- core/server/data/importer/importers/data/base.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/server/data/importer/importers/data/base.js b/core/server/data/importer/importers/data/base.js index 0a0f650dd5..e13b9179db 100644 --- a/core/server/data/importer/importers/data/base.js +++ b/core/server/data/importer/importers/data/base.js @@ -189,6 +189,11 @@ class Base { // CASE: you import null, fallback to owner if (!obj[key]) { + // Exception: If the imported post is a draft published_by will be null. Not a userReferenceProblem. + if (key === 'published_by' && obj.status === 'draft') { + return; + } + if (!userReferenceProblems[obj.id]) { userReferenceProblems[obj.id] = {obj: _.cloneDeep(obj), keys: []}; }