U4-9894 UDI Pickers and all 'v2' property editors shouldn't observe the EnablePropertyValueConverters setting

This commit is contained in:
Shannon
2017-05-29 09:38:16 +02:00
parent f962a3db20
commit d54b3a0cc3
5 changed files with 26 additions and 19 deletions

View File

@@ -50,10 +50,12 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
/// </returns>
public override bool IsConverter(PublishedPropertyType propertyType)
{
if (propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.ContentPicker2Alias))
return true;
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters)
{
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.ContentPickerAlias)
|| propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.ContentPicker2Alias);
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.ContentPickerAlias);
}
return false;
}

View File

@@ -18,16 +18,15 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
public class LegacyRelatedLinksEditorValueConvertor : PropertyValueConverterBase
{
private static readonly string[] MatchingEditors = {
Constants.PropertyEditors.RelatedLinksAlias,
Constants.PropertyEditors.RelatedLinks2Alias
};
public override bool IsConverter(PublishedPropertyType propertyType)
{
if (propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinks2Alias))
return true;
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters == false)
{
return MatchingEditors.Contains(propertyType.PropertyEditorAlias);
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinksAlias);
}
return false;
}

View File

@@ -17,12 +17,14 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
{
public override bool IsConverter(PublishedPropertyType propertyType)
{
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters)
if (propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MemberPicker2Alias))
return true;
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters == false)
{
return propertyType.PropertyEditorAlias.InvariantEquals(Constants.PropertyEditors.MemberPickerAlias)
|| propertyType.PropertyEditorAlias.InvariantEquals(Constants.PropertyEditors.MemberPicker2Alias);
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MemberPickerAlias);
}
return false;
return false;
}
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)

View File

@@ -52,12 +52,14 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
/// </returns>
public override bool IsConverter(PublishedPropertyType propertyType)
{
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters)
if (propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MultiNodeTreePicker2Alias))
return true;
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters == false)
{
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MultiNodeTreePickerAlias)
|| propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MultiNodeTreePicker2Alias);
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MultiNodeTreePickerAlias);
}
return false;
return false;
}
/// <summary>

View File

@@ -53,12 +53,14 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
/// </returns>
public override bool IsConverter(PublishedPropertyType propertyType)
{
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters)
if (propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinks2Alias))
return true;
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters == false)
{
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinksAlias)
|| propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinks2Alias);
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinksAlias);
}
return false;
return false;
}
/// <summary>