Examples:
'SimplePropertyValueConverter.IsConverter(PublishedPropertyType)': no suitable method found to override
'PublishedPropertyType' does not contain a definition for 'PropertyEditorAlias' and no accessible extension method 'PropertyEditorAlias' accepting a first argument of type 'PublishedPropertyType'
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
namespace Simple
{
public class SimplePropertyValueConverter : PropertyValueConverterBase
{
public override bool IsConverter(PublishedPropertyType propertyType)
{
return propertyType.PropertyEditorAlias != null && propertyType.PropertyEditorAlias.Equals("Simple.Editor");
}
}
}
From what I understand from that other forum thread, this should be working without any issues.
using System;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
namespace GiphyPropertyEditorUmbraco7.PropertyValueConverters
{
public class GiphyPropertyValueConverter : PropertyValueConverterBase
{
/// <summary>
/// Gets a value indicating whether the converter supports a property type.
/// </summary>
/// <param name="propertyType">The property type.</param>
/// <returns>A value indicating whether the converter supports a property type.</returns>
public bool IsConverter(PublishedPropertyType propertyType)
{
return propertyType.PropertyEditorAlias.Equals("GiphyPropertyEditorUmbraco7");
}
/// <summary>
/// Gets the type of values returned by the converter.
/// </summary>
/// <param name="propertyType">The property type.</param>
/// <returns>The CLR type of values returned by the converter.</returns>
public Type GetPropertyValueType(PublishedPropertyType propertyType)
{
return typeof(string);
}
}
}
using System;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
namespace GiphyPropertyEditor.PropertyValueConverters
{
public class GiphyPropertyValueConverter : PropertyValueConverterBase
{
/// <summary>
/// Gets a value indicating whether the converter supports a property type.
/// </summary>
/// <param name="propertyType">The property type.</param>
/// <returns>A value indicating whether the converter supports a property type.</returns>
public override bool IsConverter(PublishedPropertyType propertyType)
{
return propertyType.EditorAlias == "GiphyPropertyEditor";
}
/// <summary>
/// Gets the type of values returned by the converter.
/// </summary>
/// <param name="propertyType">The property type.</param>
/// <returns>The CLR type of values returned by the converter.</returns>
public override Type GetPropertyValueType(PublishedPropertyType propertyType)
{
return typeof(string);
}
}
}
The differences I can see are in the v8 version we are using the override keyword in the methods. And I don't know if it makes a difference but instead of .Equals the v8 version of mine is using ==
which returns Severity Code Description Project File Line Suppression State
Error CS1061 'PublishedPropertyType' does not contain a definition for 'PropertyEditorAlias' and no accessible extension method 'PropertyEditorAlias' accepting a first argument of type 'PublishedPropertyType' could be found (are you missing a using directive or an assembly reference?)
Porting a custom property editor fomr V7 to V8
Trying to port a custom property editor to V8 from V7.
Been looking at https://our.umbraco.com/forum/umbraco-8/96241-rendering-custom-property-editor-in-v8 but I still seem like I'm getting basic errors.
Examples: 'SimplePropertyValueConverter.IsConverter(PublishedPropertyType)': no suitable method found to override
'PublishedPropertyType' does not contain a definition for 'PropertyEditorAlias' and no accessible extension method 'PropertyEditorAlias' accepting a first argument of type 'PublishedPropertyType'
From what I understand from that other forum thread, this should be working without any issues.
Hi Thomas
I have a property editor package which is available for v7 and v8
Here is the Property Value Converter for v7: https://github.com/prjseal/Giphy-Property-Editor/blob/umbraco-v7/GiphyPropertyEditorUmbraco7/PropertyValueConverters/GiphyPropertyValueConverter.cs
And here is the Property Value Converter for v8: https://github.com/prjseal/Giphy-Property-Editor/blob/master/GiphyPropertyEditor/PropertyValueConverters/GiphyPropertyValueConverter.cs
The differences I can see are in the v8 version we are using the
override
keyword in the methods. And I don't know if it makes a difference but instead of.Equals
the v8 version of mine is using==
Hopefully this will help you.
Cheers
Paul
Thank you for your response, however it seems that U8 does not like the override
When I remove and use the code seems to be without errors.
instead of
which returns Severity Code Description Project File Line Suppression State Error CS1061 'PublishedPropertyType' does not contain a definition for 'PropertyEditorAlias' and no accessible extension method 'PropertyEditorAlias' accepting a first argument of type 'PublishedPropertyType' could be found (are you missing a using directive or an assembly reference?)
I will check it out further, thank you
is working on a reply...