diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 8eb29887a0..64e8ec1975 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -617,17 +617,8 @@ namespace Umbraco.Web.Editors [OutgoingEditorModelEvent] public ContentItemDisplay PostSave([ModelBinder(typeof(ContentItemBinder))] ContentItemSave contentItem) { - throw new NotImplementedException("Implement this!"); - //var contentItemDisplay = PostSaveInternal(contentItem, content => Services.ContentService.Save(contentItem.PersistedContent, Security.CurrentUser.Id)); - ////ensure the active culture is still selected - //if (!contentItem.Culture.IsNullOrWhiteSpace()) - //{ - // foreach (var contentVariation in contentItemDisplay.Variants) - // { - // contentVariation.IsCurrent = contentVariation.Language.IsoCode.InvariantEquals(contentItem.Culture); - // } - //} - //return contentItemDisplay; + var contentItemDisplay = PostSaveInternal(contentItem, content => Services.ContentService.Save(contentItem.PersistedContent, Security.CurrentUser.Id)); + return contentItemDisplay; } private ContentItemDisplay PostSaveInternal(ContentItemSave contentItem, Func saveMethod) @@ -1228,9 +1219,9 @@ namespace Umbraco.Web.Editors } //for each variant, map the property values - MapPropertyValues( + MapPropertyValuesForPersistence( contentSave, - null, //TODO: Fix this! + variant.PropertyCollectionDto, (save, property) => Varies(property) ? property.GetValue(variant.Culture) : property.GetValue(), //get prop val (save, property, v) => { if (Varies(property)) property.SetValue(v, variant.Culture); else property.SetValue(v); }); //set prop val } diff --git a/src/Umbraco.Web/Editors/ContentControllerBase.cs b/src/Umbraco.Web/Editors/ContentControllerBase.cs index 1ea1372d81..9291b2267a 100644 --- a/src/Umbraco.Web/Editors/ContentControllerBase.cs +++ b/src/Umbraco.Web/Editors/ContentControllerBase.cs @@ -45,7 +45,7 @@ namespace Umbraco.Web.Editors /// /// /// - internal void MapPropertyValues( + internal void MapPropertyValuesForPersistence( TSaved contentItem, ContentPropertyCollectionDto dto, Func getPropertyValue, diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs index 4a7dae9ed0..e48444067d 100644 --- a/src/Umbraco.Web/Editors/MediaController.cs +++ b/src/Umbraco.Web/Editors/MediaController.cs @@ -450,7 +450,7 @@ namespace Umbraco.Web.Editors contentItem.PersistedContent.Name = contentItem.Name; } - MapPropertyValues( + MapPropertyValuesForPersistence( contentItem, contentItem.PropertyCollectionDto, (save, property) => property.GetValue(), //get prop val diff --git a/src/Umbraco.Web/Editors/MemberController.cs b/src/Umbraco.Web/Editors/MemberController.cs index 448da27290..aa03628632 100644 --- a/src/Umbraco.Web/Editors/MemberController.cs +++ b/src/Umbraco.Web/Editors/MemberController.cs @@ -395,7 +395,7 @@ namespace Umbraco.Web.Editors contentItem.PersistedContent.Username = contentItem.Username; //use the base method to map the rest of the properties - base.MapPropertyValues( + base.MapPropertyValuesForPersistence( contentItem, contentItem.PropertyCollectionDto, (save, property) => property.GetValue(), //get prop val