Itera.MultiProperty and CMS 6
I tried to take the current Itera.MultiProperty project and recompile it with the CMS 6. It compiled without errors. But when you use it it throws and error complains about Multiple custom attributes of the same type found
The error is caused by some of the properties that are tagged with a
[GuiPlugIn(SortIndex = 70,DisplayName="Sort")]
public class PropertyFilterSort : PropertySortOrder, IHavePageCollectionFilter
{
and PropertySortOrder are tagged with
[Serializable, PageDefinitionTypePlugIn]
public class PropertyFileSortOrder : PropertyNumber
{
The old CMS 5 public static PlugInDescriptor Load(Type plugin) get the attributes with this line
descriptor = Load(plugin.ToString(),
plugin.Assembly.GetName().Name);
but the new CMS 6 public static PlugInDescriptor Load(Type plugin) starts to get the attribute with this line:
customAttribute = Attribute.GetCustomAttribute(
plugin,
typeof(PlugInAttribute)
) as PlugInAttribute;
Since GuiPlugIn and PageDefinitionTypePlugIn inherits from PlugInAttributes the latest get two attributes….
The quick fix is to remove
List/Filters/PropertyFilterSort.cs
and remove PageDefinitionTypePlugIn from List/PropertyIteraPagesSelector.cs
from the project and recompile.
The problem is of course that old code depending on that it’s possible to have 2 different plugin attributes will not work.
Comments