diff --git a/core/server/data/xml/sitemap/base-generator.js b/core/server/data/xml/sitemap/base-generator.js index 25591782f6..7f945ccd9f 100644 --- a/core/server/data/xml/sitemap/base-generator.js +++ b/core/server/data/xml/sitemap/base-generator.js @@ -136,6 +136,10 @@ _.extend(BaseSiteMapGenerator.prototype, { removeUrl: function (model) { var datum = model.toJSON(); + // When the model is destroyed we need to fetch previousAttributes + if (!datum.id) { + datum = model.previousAttributes(); + } this.removeFromLookups(datum); this.lastModified = Date.now(); diff --git a/core/server/models/post.js b/core/server/models/post.js index 4f9946b631..eff7229fa8 100644 --- a/core/server/models/post.js +++ b/core/server/models/post.js @@ -107,7 +107,6 @@ Post = ghostBookshelf.Model.extend({ if (model.previous('status') === 'published') { model.emitChange('unpublished'); } - model.emitChange('deleted'); }); },