umco / umbraco-ditto

Ditto - the friendly view-model mapper for Umbraco
http://our.umbraco.org/projects/developer-tools/ditto
MIT License
79 stars 33 forks source link

MultinodeTreePicker behaviour changed in 0.9.x #179

Closed JimBobSquarePants closed 8 years ago

JimBobSquarePants commented 8 years ago

In previous versions assigning a DittoPickerConverter to a MyClass would always return an IEnumberable<MyClass> whether one or many items were picked.

In 0.9.0 when a single item is picked the following exception is thrown.

Additional information: Unable to cast object of type 'System.String[]' to type 'System.Collections.Generic.IEnumerable`1[MyClass]'.

Umbraco Version 7.4.3

JimBobSquarePants commented 8 years ago

Just added a single to multiple test and it's working. Beginning to suspect this is an Umbraco 7.4.* thing

JimBobSquarePants commented 8 years ago

So it turns out that the difference was that when searching for attributes on type declarations we were no longer searching the type parameters within generic types. This meant pickers were no longer working without having both UmbracoProperty and UmbracoPicker defined on the property.