Because I like to return my own type of object for Related Links I wrote an IPropertyEditorValueConverter in v6. This implementation does not work anymore in v7 so currently I am changing this to a IPropertyValueConverter. But then I got this error:
Type 'Implementation.Converters.RelatedLinks'
cannot be an IPropertyValueConverter for property 'socialNetworks' of
content type 'Home' because type
'Umbraco.Web.PropertyEditors.ValueConverters.RelatedLinksEditorValueConvertor'
has already been detected as a converter for that property, and only
one converter can exist for a property.
This is a part of my code:
public class RelatedLinks : PropertyValueConverterBase
{
public override bool IsConverter(PublishedPropertyType propertyType)
{
return Constants.PropertyEditors.RelatedLinksAlias.Equals(propertyType.PropertyEditorAlias);
}
It seems this problem only occurs for RelatedLinks. So this looks like a bug for me. Other converters for Content, Macro, en Mediapicker work as expected. However, the problem I tried to solve is fixed. Because Umbraco returns a JArray which you can be used like an object in a Razor view. And the (JSON Array) object it returns is a nice object by it self, so I don't need to cast is to my own type of object. For example the next piece works, fine:
@foreach(var linkItem in @CurrentPage.SocialNetworks)
{
<a href="@linkItem.link">some text</a>
}
Problems again. When the link is internal it only returns an id. I need the friendly url and there for I like to create my own Converter again. Which is not possible because of the error. Hopefully someone could tell me this is fixed in the next release of Umbraco v7.. Anyone?
How to overrule a core PropertyValueConverter
Because I like to return my own type of object for Related Links I wrote an IPropertyEditorValueConverter in v6. This implementation does not work anymore in v7 so currently I am changing this to a IPropertyValueConverter. But then I got this error:
This is a part of my code:
Could any one please help me out?
It seems this problem only occurs for RelatedLinks. So this looks like a bug for me. Other converters for Content, Macro, en Mediapicker work as expected. However, the problem I tried to solve is fixed. Because Umbraco returns a JArray which you can be used like an object in a Razor view. And the (JSON Array) object it returns is a nice object by it self, so I don't need to cast is to my own type of object. For example the next piece works, fine:
Problems again. When the link is internal it only returns an id. I need the friendly url and there for I like to create my own Converter again. Which is not possible because of the error. Hopefully someone could tell me this is fixed in the next release of Umbraco v7.. Anyone?
watch this issue:
http://issues.umbraco.org/issue/U4-4030
Thanks!
is working on a reply...