From 3cf3e5b5c4f4fae9d5e28ff8df430f7da7ed57fe Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Fri, 18 Nov 2022 19:07:03 +0100 Subject: [PATCH] Updated content importer to fail only on errors no refs. - the content importer sent an "Import failed" email even if only warnings occured during import --- ghost/core/core/server/data/importer/email-template.js | 4 ++-- ghost/core/core/server/data/importer/import-manager.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ghost/core/core/server/data/importer/email-template.js b/ghost/core/core/server/data/importer/email-template.js index ffca281192..a425736c2f 100644 --- a/ghost/core/core/server/data/importer/email-template.js +++ b/ghost/core/core/server/data/importer/email-template.js @@ -122,10 +122,10 @@ module.exports = ({result, siteUrl, postsUrl, emailRecipient}) => ` -

${result.data.problems.length ? 'Import unsuccessful' : 'Your content import has finished successfully'}

+

${result?.data?.errors ? 'Import unsuccessful' : 'Your content import has finished successfully'}

- ${result.data.problems.length ? ` + ${result?.data?.errors ? ` One or more error occured while importing your content. Please contact support or report on the Ghost Community Forum. diff --git a/ghost/core/core/server/data/importer/import-manager.js b/ghost/core/core/server/data/importer/import-manager.js index 1fa7748065..1183788b4f 100644 --- a/ghost/core/core/server/data/importer/import-manager.js +++ b/ghost/core/core/server/data/importer/import-manager.js @@ -451,7 +451,7 @@ class ImportManager { }); await ghostMailer.send({ to: importOptions.user.email, - subject: importResult.data.problems.length + subject: importResult.data?.errors ? 'Your content import was unsuccessful' : 'Your content import has finished', html: email