Fixes U4-11574 - return an empty string if the datatype is in "single" mode and nothing is selected

This commit is contained in:
Sebastiaan Janssen
2018-08-20 16:12:01 +02:00
parent 89f69bd2a8
commit e6597d47e3

View File

@@ -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)