You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you add more than one fields with PreValues, the ValidateSettings methode gets the wrong setting value.
Hard to explain so here are some screenshots:
The message appears, i choos "Emailaddress". Then i add an other field of the same type and call this "Lastname" and again choose no value for ProfileField.
Reproduction
Here is an example class of the formfield:
public class TestField : FieldType
{
[Setting("ProfileField", Description = "", View = "Dropdownlist", PreValues = "Name, Emailaddress, Phone")]
public string ProfileField { get; set; }
public TestField(IScopeProvider scopeProvider)
{
Id = new Guid("6e73befe-c39e-436f-ac45-240ed645889e");
Name = "Testfield";
Description = "Test";
DataType = FieldDataType.String;
FieldTypeViewName = "FieldType.Test.cshtml";
Icon = "icon-user ";
HideLabel = false;
SupportsPreValues = false;
SupportsRegex = false;
SortOrder = 25;
}
public override List<Exception> ValidateSettings()
{
List<Exception> exceptions = new List<Exception>();
if (string.IsNullOrEmpty(this.ProfileField))
exceptions.Add(new Exception("Choose a value"));
return exceptions;
}
}
Expected result
I would expect that the setting value of ProfileField == null when no PreValue is chosen.
Actual result
The prevalue of the first set field is passed
The text was updated successfully, but these errors were encountered:
When you add more than one fields with PreValues, the ValidateSettings methode gets the wrong setting value.
Hard to explain so here are some screenshots:
The message appears, i choos "Emailaddress". Then i add an other field of the same type and call this "Lastname" and again choose no value for ProfileField.
Reproduction
Here is an example class of the formfield:
Expected result
I would expect that the setting value of ProfileField == null when no PreValue is chosen.
Actual result
The prevalue of the first set field is passed
The text was updated successfully, but these errors were encountered: