From ef46774afc22d768024f70f82c529a98bee7d030 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 6 Feb 2019 15:54:22 +0000 Subject: [PATCH 1/2] Bumping version number for hotfixes [skip ci] --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 880e43e..31bdb4c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ image: Visual Studio 2017 # version format -version: 2.0.3.{build} +version: 2.0.4.{build} # UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha # example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta From cc16c58a51088d581d43c0547bf589b7bf4914fd Mon Sep 17 00:00:00 2001 From: Dan White Date: Wed, 13 Mar 2019 11:29:08 -0700 Subject: [PATCH 2/2] Copy non-primitive types before assigned to prop.value on editormodel Makes discard unsaved changes work when model.value is an object. --- .../Web/UI/App_Plugins/InnerContent/js/innercontent.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/js/innercontent.js b/src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/js/innercontent.js index 457e607..62d7661 100644 --- a/src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/js/innercontent.js +++ b/src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/js/innercontent.js @@ -465,6 +465,10 @@ angular.module("umbraco").factory("innerContentService", [ } }; + var isPrimitive = function (test) { + return (test !== Object(test)); + }; + self.populateName = function (itm, idx, contentTypes) { var contentType = _.find(contentTypes, function (itm2) { @@ -532,7 +536,7 @@ angular.module("umbraco").factory("innerContentService", [ for (var p = 0; p < tab.properties.length; p++) { var prop = tab.properties[p]; if (dbModel.hasOwnProperty(prop.alias)) { - prop.value = dbModel[prop.alias]; + prop.value = isPrimitive(dbModel[prop.alias]) ? dbModel[prop.alias] : angular.copy(dbModel[prop.alias]); } } }