Fixes U4-11574 - return an empty string if the datatype is in "single" mode and nothing is selected
This commit is contained in:
@@ -42,18 +42,19 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
|
||||
return null;
|
||||
}
|
||||
|
||||
var isMultipleDataType = IsMultipleDataType(propertyType.DataTypeId, propertyType.PropertyEditorAlias);
|
||||
|
||||
var selectedValues = (string[]) source;
|
||||
|
||||
if (selectedValues.Any())
|
||||
{
|
||||
if (IsMultipleDataType(propertyType.DataTypeId, propertyType.PropertyEditorAlias))
|
||||
{
|
||||
if (isMultipleDataType)
|
||||
return selectedValues;
|
||||
}
|
||||
|
||||
return selectedValues.First();
|
||||
}
|
||||
|
||||
return source;
|
||||
return isMultipleDataType ? source : string.Empty;
|
||||
}
|
||||
|
||||
public Type GetPropertyValueType(PublishedPropertyType propertyType)
|
||||
|
||||
Reference in New Issue
Block a user