From e7162d46ce359fdff8e78f19abe6ae088bfea2f1 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 15 Oct 2013 15:12:44 +1100 Subject: [PATCH] ignores some properties from being updated after saving otherwise we get duplicate tabs, etc... --- .../common/services/contenteditinghelper.service.js | 12 ++++++++++++ .../Models/ContentEditing/ContentItemDisplay.cs | 3 --- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js index 2f551f80a3..28f8679d1a 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js @@ -52,8 +52,20 @@ function contentEditingHelper($location, $routeParams, notificationsService, ser }); } + //a method to ignore built-in prop changes + var shouldIgnore = function(propName) { + return _.some(["tabs", "notifications", "ModelState", "tabs", "properties"], function(i) { + return i === propName; + }); + }; //check for changed built-in properties of the content for (var o in origContent) { + + //ignore the ones listed in the array + if (shouldIgnore(o)) { + continue; + } + if (!_.isEqual(origContent[o], newContent[o])) { origContent[o] = newContent[o]; } diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs index 3987fbbeae..974b5f325e 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs @@ -14,9 +14,6 @@ namespace Umbraco.Web.Models.ContentEditing [DataContract(Name = "content", Namespace = "")] public class ContentItemDisplay : ContentItemDisplayBase { - [DataMember(Name = "path")] - public string Path { get; set; } - [DataMember(Name = "publishDate")] public DateTime? PublishDate { get; set; }