Values converter for Multinode Treepicker in nested content does not work, but it does for Media Picker
I am very frustrated, because I have not been able to get this to work for hours.
I have two different Nested Content data types, one has a Media Picker and some more properties, the other one has a Multinode Treepicker and some more properties.
When i try to get the value of the media picker, like item.GetPropertyValue<IPublishedContent>("imagePicker"), it works, i get the values as an IPublishedContent just fine.
Now, when i try to get the value of the Multinode Treepicker in the other Nested Content data type, i only get null. I call it like the documentation says you should call it (basically, like the Media Picker). If I try to get the value, without casting it (item.GetPropertyValue("propAlias")), I get the value just fine, but the second I try to cast it to an IPublishedContent, I get NULL. It's the same for a Multinode Treepicker with multiple items: when I try to cast it, I get NULL.
That is exactly the way I do it.
But it does not work.
It works on a Media Picker, and a regular Multinode Treepicker outside of a Nested Content data type.
I can also get the value of the Multinode Treepicker by not casting to an IEnumerable, but as soon as I try to cast it, it returns NULL.
I just went back to my machine, to run a debug and check the type.
I tried to change the Multinode Treepicker that I would cast without an IEnumerable, to <IEnumerable<IPublishedContent>> and now it works.
I am baffled... I had been debugging for hours, and I am 100% sure I tried that also... I should have just gone home for the day :P
Values converter for Multinode Treepicker in nested content does not work, but it does for Media Picker
I am very frustrated, because I have not been able to get this to work for hours.
I have two different Nested Content data types, one has a Media Picker and some more properties, the other one has a Multinode Treepicker and some more properties.
When i try to get the value of the media picker, like
item.GetPropertyValue<IPublishedContent>("imagePicker")
, it works, i get the values as anIPublishedContent
just fine.Now, when i try to get the value of the Multinode Treepicker in the other Nested Content data type, i only get null. I call it like the documentation says you should call it (basically, like the Media Picker). If I try to get the value, without casting it (
item.GetPropertyValue("propAlias")
), I get the value just fine, but the second I try to cast it to anIPublishedContent
, I get NULL. It's the same for a Multinode Treepicker with multiple items: when I try to cast it, I get NULL.Help me, you are my only hope.
Hi Andreas,
The Multinode Treepicker always returns an IEnumerable in my experience.
Try
See how you get on with that.
Nik
Hi Nik.
That is exactly the way I do it. But it does not work. It works on a Media Picker, and a regular Multinode Treepicker outside of a Nested Content data type.
I can also get the value of the Multinode Treepicker by not casting to an IEnumerable, but as soon as I try to cast it, it returns NULL.
Hi Andreas
What version of Umbraco are you using?
Also, if you get the value by not specifying it and look at it in a watch/local window when debugging, can you see what type it is?
Thanks
Nik
Hi Nik.
I am running 7.13.
BUT!
I just went back to my machine, to run a debug and check the type. I tried to change the Multinode Treepicker that I would cast without an IEnumerable, to
<IEnumerable<IPublishedContent>>
and now it works.I am baffled... I had been debugging for hours, and I am 100% sure I tried that also... I should have just gone home for the day :P
is working on a reply...