diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs index 051baea3eb..6ae751de14 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs @@ -18,6 +18,7 @@ using umbraco.cms.businesslogic.web; using umbraco.interfaces; using umbraco.uicontrols; using Content = umbraco.cms.businesslogic.Content; +using ContentType = umbraco.cms.businesslogic.ContentType; using Media = umbraco.cms.businesslogic.media.Media; using Property = umbraco.cms.businesslogic.property.Property; using StylesheetProperty = umbraco.cms.businesslogic.web.StylesheetProperty; @@ -31,18 +32,15 @@ namespace umbraco.controls /// public class ContentControl : TabView { - private readonly Content _content; - internal Dictionary DataTypes = new Dictionary(); - private UmbracoEnsuredPage _prntpage; public ContentControl() { //by default set this to true for content SavePropertyDataWhenInvalid = true; } - + + internal Dictionary DataTypes = new Dictionary(); private readonly Content _content; - private readonly ArrayList _dataFields = new ArrayList(); private UmbracoEnsuredPage _prntpage; public event EventHandler SaveAndPublish; public event EventHandler SaveToPublish; @@ -360,16 +358,16 @@ namespace umbraco.controls } } - foreach (var property in DataTypes) - { - var defaultData = property.Value.Data as DefaultData; - if (defaultData != null) + foreach (var property in DataTypes) { - defaultData.PropertyTypeAlias = property.Key; - defaultData.NodeId = _content.Id; + var defaultData = property.Value.Data as DefaultData; + if (defaultData != null) + { + defaultData.PropertyTypeAlias = property.Key; + defaultData.NodeId = _content.Id; + } + property.Value.DataEditor.Save(); } - property.Value.DataEditor.Save(); - } //don't update if the name is empty if (!NameTxt.Text.IsNullOrWhiteSpace()) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs index adbe86d761..9b30dcdbb1 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs @@ -2,6 +2,7 @@ using System; using System.Web.UI; using System.Web.UI.WebControls; using Umbraco.Core.IO; +using Umbraco.Core.Services; using umbraco.BusinessLogic.Actions; using umbraco.uicontrols.DatePicker; using umbraco.BusinessLogic; @@ -313,9 +314,7 @@ namespace umbraco.cms.presentation if (_document.Level == 1 || _document.PathPublished) { var previouslyPublished = _document.HasPublishedVersion(); - - Trace.Warn("before d.publish"); - + if (_document.PublishWithResult(base.getUser(), false)) { ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editContentPublishedHeader", null), ui.Text("speechBubbles", "editContentPublishedText", null)); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/editMedia.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/editMedia.aspx.cs index 9dfa662532..a3f14fa9e4 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/editMedia.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/editMedia.aspx.cs @@ -109,7 +109,7 @@ namespace umbraco.cms.presentation //so we need to 'retrieve' that value and set it on the property of the new IContent object. //NOTE This is a workaround for the legacy approach to saving values through the DataType instead of the Property //- (The DataType shouldn't be responsible for saving the value - especically directly to the db). - foreach (var item in tmp.DataTypes) + foreach (var item in _contentControl.DataTypes) { _media.getProperty(item.Key).Value = item.Value.Data.Value; } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMember.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMember.aspx.cs index 27897c3e25..8eb6d893ef 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMember.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMember.aspx.cs @@ -191,7 +191,7 @@ namespace umbraco.cms.presentation.members //so we need to 'retrieve' that value and set it on the property of the new IContent object. //NOTE This is a workaround for the legacy approach to saving values through the DataType instead of the Property //- (The DataType shouldn't be responsible for saving the value - especically directly to the db). - foreach (var item in tmp.DataTypes) + foreach (var item in _contentControl.DataTypes) { _document.getProperty(item.Key).Value = item.Value.Data.Value; } @@ -224,8 +224,7 @@ namespace umbraco.cms.presentation.members } - ClientTools.ShowSpeechBubble(BasePages.BasePage.speechBubbleIcon.save, - ui.Text("speechBubbles", "editMemberSaved", base.getUser()), ""); + ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editMemberSaved", base.getUser()), ""); } }