Fix errors
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
|
||||
public class PropertyTypeValidation
|
||||
{
|
||||
[DataMember(Name = "mandatory")]
|
||||
public bool? Mandatory { get; set; }
|
||||
public bool Mandatory { get; set; }
|
||||
|
||||
[DataMember(Name = "mandatoryMessage")]
|
||||
public string? MandatoryMessage { get; set; }
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Umbraco.Cms.Core.Models
|
||||
/// <summary>
|
||||
/// Gets of sets a value indicating whether a value for this property type is required.
|
||||
/// </summary>
|
||||
bool? Mandatory { get; set; }
|
||||
bool Mandatory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the label of this property type should be displayed on top.
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
dest.LabelOnTop = originalProp.PropertyType?.LabelOnTop;
|
||||
|
||||
//add the validation information
|
||||
dest.Validation.Mandatory = originalProp.PropertyType?.Mandatory;
|
||||
dest.Validation.Mandatory = originalProp.PropertyType?.Mandatory ?? false;
|
||||
dest.Validation.MandatoryMessage = originalProp.PropertyType?.MandatoryMessage;
|
||||
dest.Validation.Pattern = originalProp.PropertyType?.ValidationRegExp;
|
||||
dest.Validation.PatternMessage = originalProp.PropertyType?.ValidationRegExpMessage;
|
||||
|
||||
@@ -317,7 +317,7 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
target.Name = source.Label;
|
||||
target.DataTypeId = source.DataTypeId;
|
||||
target.DataTypeKey = source.DataTypeKey;
|
||||
target.Mandatory = source.Validation?.Mandatory;
|
||||
target.Mandatory = source.Validation?.Mandatory ?? false;
|
||||
target.MandatoryMessage = source.Validation?.MandatoryMessage;
|
||||
target.ValidationRegExp = source.Validation?.Pattern;
|
||||
target.ValidationRegExpMessage = source.Validation?.PatternMessage;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Umbraco.Cms.Core.Models
|
||||
private Lazy<int>? _propertyGroupId;
|
||||
private string _propertyEditorAlias;
|
||||
private ValueStorageType _valueStorageType;
|
||||
private bool? _mandatory;
|
||||
private bool _mandatory;
|
||||
private string? _mandatoryMessage;
|
||||
private int _sortOrder;
|
||||
private string? _validationRegExp;
|
||||
@@ -178,7 +178,7 @@ namespace Umbraco.Cms.Core.Models
|
||||
|
||||
/// <inheritdoc />
|
||||
[DataMember]
|
||||
public bool? Mandatory
|
||||
public bool Mandatory
|
||||
{
|
||||
get => _mandatory;
|
||||
set => SetPropertyValueAndDetectChanges(value, ref _mandatory, nameof(Mandatory));
|
||||
|
||||
Reference in New Issue
Block a user