Merge remote-tracking branch 'origin/netcore/dev' into netcore/feature/AB3970-membership-providers
# Conflicts: # src/Umbraco.Web/Editors/Filters/MemberSaveModelValidator.cs # src/Umbraco.Web/Editors/Filters/MemberSaveValidationAttribute.cs
This commit is contained in:
@@ -45,7 +45,9 @@ namespace Umbraco.Web.Models.Mapping
|
||||
|
||||
//add the validation information
|
||||
dest.Validation.Mandatory = originalProp.PropertyType.Mandatory;
|
||||
dest.Validation.MandatoryMessage = originalProp.PropertyType.MandatoryMessage;
|
||||
dest.Validation.Pattern = originalProp.PropertyType.ValidationRegExp;
|
||||
dest.Validation.PatternMessage = originalProp.PropertyType.ValidationRegExpMessage;
|
||||
|
||||
if (dest.PropertyEditor == null)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,9 @@ namespace Umbraco.Web.Models.Mapping
|
||||
base.Map(property, dest, context);
|
||||
|
||||
dest.IsRequired = property.PropertyType.Mandatory;
|
||||
dest.IsRequiredMessage = property.PropertyType.MandatoryMessage;
|
||||
dest.ValidationRegExp = property.PropertyType.ValidationRegExp;
|
||||
dest.ValidationRegExpMessage = property.PropertyType.ValidationRegExpMessage;
|
||||
dest.Description = property.PropertyType.Description;
|
||||
dest.Label = property.PropertyType.Name;
|
||||
dest.DataType = DataTypeService.GetDataType(property.PropertyType.DataTypeId);
|
||||
|
||||
@@ -222,9 +222,13 @@ namespace Umbraco.Web.Models.Mapping
|
||||
target.DataTypeId = source.DataTypeId;
|
||||
target.DataTypeKey = source.DataTypeKey;
|
||||
target.Mandatory = source.Validation.Mandatory;
|
||||
target.MandatoryMessage = source.Validation.MandatoryMessage;
|
||||
target.ValidationRegExp = source.Validation.Pattern;
|
||||
target.Variations = source.AllowCultureVariant ? ContentVariation.Culture : ContentVariation.Nothing;
|
||||
|
||||
target.ValidationRegExpMessage = source.Validation.PatternMessage;
|
||||
target.Variations = source.AllowCultureVariant
|
||||
? target.Variations.SetFlag(ContentVariation.Culture)
|
||||
: target.Variations.UnsetFlag(ContentVariation.Culture);
|
||||
|
||||
if (source.Id > 0)
|
||||
target.Id = source.Id;
|
||||
|
||||
@@ -395,9 +399,9 @@ namespace Umbraco.Web.Models.Mapping
|
||||
|
||||
if (!(target is IMemberType))
|
||||
{
|
||||
target.Variations = ContentVariation.Nothing;
|
||||
if (source.AllowCultureVariant)
|
||||
target.Variations |= ContentVariation.Culture;
|
||||
target.Variations = source.AllowCultureVariant
|
||||
? target.Variations.SetFlag(ContentVariation.Culture)
|
||||
: target.Variations.UnsetFlag(ContentVariation.Culture);
|
||||
}
|
||||
|
||||
// handle property groups and property types
|
||||
|
||||
@@ -223,7 +223,13 @@ namespace Umbraco.Web.Models.Mapping
|
||||
Alias = p.Alias,
|
||||
Description = p.Description,
|
||||
Editor = p.PropertyEditorAlias,
|
||||
Validation = new PropertyTypeValidation {Mandatory = p.Mandatory, Pattern = p.ValidationRegExp},
|
||||
Validation = new PropertyTypeValidation
|
||||
{
|
||||
Mandatory = p.Mandatory,
|
||||
MandatoryMessage = p.MandatoryMessage,
|
||||
Pattern = p.ValidationRegExp,
|
||||
PatternMessage = p.ValidationRegExpMessage,
|
||||
},
|
||||
Label = p.Name,
|
||||
View = propertyEditor.GetValueEditor().View,
|
||||
Config = config,
|
||||
|
||||
Reference in New Issue
Block a user