It saves (not publishing though)! now on to validation
This commit is contained in:
@@ -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<IContent, OperationResult> saveMethod)
|
||||
@@ -1228,9 +1219,9 @@ namespace Umbraco.Web.Editors
|
||||
}
|
||||
|
||||
//for each variant, map the property values
|
||||
MapPropertyValues<IContent, ContentItemSave>(
|
||||
MapPropertyValuesForPersistence<IContent, ContentItemSave>(
|
||||
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
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Umbraco.Web.Editors
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="getPropertyValue"></param>
|
||||
/// <param name="savePropertyValue"></param>
|
||||
internal void MapPropertyValues<TPersisted, TSaved>(
|
||||
internal void MapPropertyValuesForPersistence<TPersisted, TSaved>(
|
||||
TSaved contentItem,
|
||||
ContentPropertyCollectionDto dto,
|
||||
Func<TSaved, Property, object> getPropertyValue,
|
||||
|
||||
@@ -450,7 +450,7 @@ namespace Umbraco.Web.Editors
|
||||
contentItem.PersistedContent.Name = contentItem.Name;
|
||||
}
|
||||
|
||||
MapPropertyValues<IMedia, MediaItemSave>(
|
||||
MapPropertyValuesForPersistence<IMedia, MediaItemSave>(
|
||||
contentItem,
|
||||
contentItem.PropertyCollectionDto,
|
||||
(save, property) => property.GetValue(), //get prop val
|
||||
|
||||
@@ -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<IMember, MemberSave>(
|
||||
base.MapPropertyValuesForPersistence<IMember, MemberSave>(
|
||||
contentItem,
|
||||
contentItem.PropertyCollectionDto,
|
||||
(save, property) => property.GetValue(), //get prop val
|
||||
|
||||
Reference in New Issue
Block a user