Makes State a ContentSavedState enum nullable - otherwise media items was getting a default enum of not created
This commit is contained in:
@@ -5,9 +5,6 @@ using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Validation;
|
||||
using Umbraco.Web.WebApi;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
@@ -47,7 +44,7 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
|
||||
[DataMember(Name = "state")]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ContentSavedState State { get; set; }
|
||||
public ContentSavedState? State { get; set; } = null;
|
||||
|
||||
protected bool Equals(ContentItemBasic other)
|
||||
{
|
||||
|
||||
@@ -92,14 +92,15 @@ namespace Umbraco.Web.Models.Mapping
|
||||
}
|
||||
}
|
||||
|
||||
internal class CultureStateResolver : IValueResolver<IContent, ContentItemBasic<ContentPropertyBasic>, ContentSavedState>
|
||||
internal class CultureStateResolver : IValueResolver<IContent, ContentItemBasic<ContentPropertyBasic>, ContentSavedState?>
|
||||
{
|
||||
//WB: Note this is same logic as ContentSavedStateResolver.cs
|
||||
//But this is for ContentItemBasic instead of ContentVariantDisplay
|
||||
public ContentSavedState Resolve(IContent source, ContentItemBasic<ContentPropertyBasic> destination, ContentSavedState destMember, ResolutionContext context)
|
||||
public ContentSavedState? Resolve(IContent source, ContentItemBasic<ContentPropertyBasic> destination, ContentSavedState? destMember, ResolutionContext context)
|
||||
{
|
||||
PublishedState publishedState;
|
||||
bool isEdited;
|
||||
|
||||
|
||||
if (source.ContentType.VariesByCulture())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user