From e8c4063ed1c03ce5c36f59fdb1ed48cb5c05f686 Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 10 Jun 2013 15:58:52 -0200 Subject: [PATCH] Fixes data saving services --- src/Umbraco.Web.UI.Client/build/belle/js/umbraco.services.js | 4 ++++ .../src/common/services/utill.service.js | 4 ++++ src/Umbraco.Web/WebApi/Binders/ContentItemBinder.cs | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/build/belle/js/umbraco.services.js b/src/Umbraco.Web.UI.Client/build/belle/js/umbraco.services.js index 54b2f35205..4f483dbf97 100644 --- a/src/Umbraco.Web.UI.Client/build/belle/js/umbraco.services.js +++ b/src/Umbraco.Web.UI.Client/build/belle/js/umbraco.services.js @@ -664,6 +664,9 @@ function umbDataFormatter() { var saveModel = { id: displayModel.id, properties: [], + name: displayModel.name, + contentTypeAlias : displayModel.contentTypeAlias, + parentId: displayModel.parentId, //set the action on the save model action: action }; @@ -671,6 +674,7 @@ function umbDataFormatter() { _.each(tab.properties, function (prop) { saveModel.properties.push({ id: prop.id, + alias: prop.alias, value: prop.value }); }); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/utill.service.js b/src/Umbraco.Web.UI.Client/src/common/services/utill.service.js index a0e88b4437..1882b9f7b3 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/utill.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/utill.service.js @@ -79,6 +79,9 @@ function umbDataFormatter() { var saveModel = { id: displayModel.id, properties: [], + name: displayModel.name, + contentTypeAlias : displayModel.contentTypeAlias, + parentId: displayModel.parentId, //set the action on the save model action: action }; @@ -86,6 +89,7 @@ function umbDataFormatter() { _.each(tab.properties, function (prop) { saveModel.properties.push({ id: prop.id, + alias: prop.alias, value: prop.value }); }); diff --git a/src/Umbraco.Web/WebApi/Binders/ContentItemBinder.cs b/src/Umbraco.Web/WebApi/Binders/ContentItemBinder.cs index 2871104aeb..c3be767a7b 100644 --- a/src/Umbraco.Web/WebApi/Binders/ContentItemBinder.cs +++ b/src/Umbraco.Web/WebApi/Binders/ContentItemBinder.cs @@ -136,7 +136,7 @@ namespace Umbraco.Web.WebApi.Binders }); } - if (model.Action == ContentSaveAction.Publish && model.Action == ContentSaveAction.Save) + if (model.Action == ContentSaveAction.Publish || model.Action == ContentSaveAction.Save) { //finally, let's lookup the real content item and create the DTO item model.PersistedContent = _applicationContext.Services.ContentService.GetById(model.Id);