Merge pull request #1969 from umbraco/temp-U4-9974

U4-9974 EnablePropertyValueConverter does the opposite
This commit is contained in:
Sebastiaan Janssen
2017-06-01 13:32:51 +02:00
committed by GitHub
5 changed files with 16 additions and 11 deletions

View File

@@ -21,12 +21,9 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
public override bool IsConverter(PublishedPropertyType propertyType)
{
if (propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinks2Alias))
return true;
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters == false)
{
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinksAlias);
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinksAlias);
}
return false;
}

View File

@@ -12,6 +12,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
@@ -122,7 +123,14 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
/// </returns>
public override bool IsConverter(PublishedPropertyType propertyType)
{
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MediaPicker2Alias);
if (propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MediaPicker2Alias))
return true;
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters)
{
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MediaPickerAlias);
}
return false;
}
/// <summary>

View File

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

View File

@@ -55,11 +55,11 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
if (propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MultiNodeTreePicker2Alias))
return true;
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters == false)
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters)
{
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MultiNodeTreePickerAlias);
}
return false;
return false;
}
/// <summary>

View File

@@ -56,11 +56,11 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
if (propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinks2Alias))
return true;
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters == false)
if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters)
{
return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.RelatedLinksAlias);
}
return false;
return false;
}
/// <summary>