diff --git a/core/server/data/importer/importers/data/index.js b/core/server/data/importer/importers/data/index.js index 3fbe61e2c3..4d3a93bc68 100644 --- a/core/server/data/importer/importers/data/index.js +++ b/core/server/data/importer/importers/data/index.js @@ -42,6 +42,7 @@ DataImporter = { if (importOptions && importOptions.importPersistUser) { modelOptions.importPersistUser = importOptions.importPersistUser; } + this.init(importData); return models.Base.transaction(function (transacting) { diff --git a/core/server/models/base/index.js b/core/server/models/base/index.js index 4c34db16c6..ecfb243707 100644 --- a/core/server/models/base/index.js +++ b/core/server/models/base/index.js @@ -774,6 +774,12 @@ ghostBookshelf.Model = ghostBookshelf.Model.extend({ if (!slug) { slug = baseName; } + + // CASE: no slug generation on import, see https://github.com/TryGhost/Ghost/issues/8717 + if (options.importing) { + return slug; + } + // Test for duplicate slugs. return checkIfSlugExists(slug); }); diff --git a/core/test/integration/data/importer/importers/data_spec.js b/core/test/integration/data/importer/importers/data_spec.js index fad272df02..cd88e5df14 100644 --- a/core/test/integration/data/importer/importers/data_spec.js +++ b/core/test/integration/data/importer/importers/data_spec.js @@ -394,6 +394,8 @@ describe('Import', function () { exportData = exported; return dataImporter.doImport(exportData); }).then(function (importedData) { + importedData.data.posts.length.should.eql(1); + importedData.problems.length.should.eql(3); importedData.problems[0].message.should.eql('Entry was not imported and ignored. Detected duplicated entry.'); importedData.problems[0].help.should.eql('Tag');