Skip to content

Commit

Permalink
Merge pull request #1969 from umbraco/temp-U4-9974
Browse files Browse the repository at this point in the history
U4-9974 EnablePropertyValueConverter does the opposite
  • Loading branch information
nul800sebastiaan authored Jun 1, 2017
2 parents 7e6f7f8 + c5419e7 commit 92f609f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ public class LegacyRelatedLinksEditorValueConvertor : PropertyValueConverterBase

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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
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;
Expand Down Expand Up @@ -122,7 +123,14 @@ private bool IsMultipleDataType(int dataTypeId, string propertyEditorAlias)
/// </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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public override bool IsConverter(PublishedPropertyType propertyType)
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public override bool IsConverter(PublishedPropertyType propertyType)
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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public override bool IsConverter(PublishedPropertyType propertyType)
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>
Expand Down

0 comments on commit 92f609f

Please sign in to comment.