From d27f32fb4d34b22d98d501dc17fc8a9661f5f6bb Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Sun, 7 Jul 2013 19:41:05 +0100 Subject: [PATCH] Bug fix - unable to publish - The addition of published/draft statuses to the post model on the frontend was being returned to the server. - These additional properties are client-side only and are now unset before the model is saved --- core/admin/assets/js/models/post.js | 2 ++ core/admin/assets/js/views/editor.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/core/admin/assets/js/models/post.js b/core/admin/assets/js/models/post.js index 3f58f18547..6028aab64f 100644 --- a/core/admin/assets/js/models/post.js +++ b/core/admin/assets/js/models/post.js @@ -8,6 +8,8 @@ status: 'draft' }, + blacklist: ['published', 'draft'], + parse: function (resp) { if (resp.status) { resp.published = !!(resp.status === "published"); diff --git a/core/admin/assets/js/views/editor.js b/core/admin/assets/js/views/editor.js index 9876c3c619..25922a0eb0 100644 --- a/core/admin/assets/js/views/editor.js +++ b/core/admin/assets/js/views/editor.js @@ -130,6 +130,10 @@ savePost: function (data) { // TODO: The content getter here isn't great, shouldn't rely on currentView. + _.each(this.model.blacklist, function (item) { + this.model.unset(item); + }, this); + var saved = this.model.save(_.extend({ title: $('#entry-title').val(), content: Ghost.currentView.editor.getValue()