Nested Content - Dropdown value is missing on retrieval
Hello, I have a very odd issue that I hope someone can assist with.
In an Umbraco v.7.10.3 site I have a doctype "Recipe" with a Nested Content property named "Instructions". The Nested Content item has two properties - a Textarea ("InstructionText") and a simple drop-down ("TextType")
In the back-office, I can add multiple "Instructions" to a Recipe and I see the drop-down value displayed properly. If I save the Recipe and come back to it, the instructions are still showing proper drop-down values.
However, when I attempt to render the data in a View, "TextType" is always null.
example Razor:
var rIpub = Umbraco.AssignedContentItem;
var rInstrIpub = rIpub.GetPropertyValue<IEnumerable<IPublishedContent>>("Instructions");
var firstTest = rInstrIpub.FirstOrDefault().GetPropertyValue("TextType"); <--- NULL
When I checked the XML data in umbraco.config, I see that it is saving an empty string for all the TextType properties:
<Instructions><![CDATA[[
{"key":"23de4eed-b446-4313-b070-0f137b878d41","name":"Preheat oven to 450º F.","ncContentTypeAlias":"ncRecipeInstruction","InstructionText":"Preheat oven to 450º F.","TextType":""},
{"key":"fc025a97-21a8-493d-8d17-97040b472348","name":"Brush each pizza crust with olive oil.","ncContentTypeAlias":"ncRecipeInstruction","InstructionText":"Brush each pizza crust with olive oil.","TextType":""}
...
]]]></Instructions>
Thank you for your response, Nigel, however my properties are title cased (I know I am peculiar). You can verify it in the umbraco.config sample I included. Just because stranger things have happened, I went ahead and re-ran my Razor test using your suggestion, but as I suspected, the value is still NULL.
Thanks for the bread crumbs! In my situation I'm still using the original .5 Nested Content package as it was too significant to move everything to Umbraco's Shipped NC, but I'm also on Umbraco 7.10.4
I had to add a new drop down, and was experiencing this issue where the value was always NULL. As a workaround to this issue, you can also manually modify the data type in the database to use the legacy drop down.
1) Go to Developer -> Data Types -> The Drop Down In Question
2) Note the ID /umbraco/#/developer/dataTypes/edit/123456
3) Open SSMS, cmsDataType table, find your data type and change the propertyEditorAlias to Umbraco.DropDown which I assume is the legacy drop down?
Nested Content - Dropdown value is missing on retrieval
Hello, I have a very odd issue that I hope someone can assist with.
In an Umbraco v.7.10.3 site I have a doctype "Recipe" with a Nested Content property named "Instructions". The Nested Content item has two properties - a Textarea ("InstructionText") and a simple drop-down ("TextType")
In the back-office, I can add multiple "Instructions" to a Recipe and I see the drop-down value displayed properly. If I save the Recipe and come back to it, the instructions are still showing proper drop-down values.
However, when I attempt to render the data in a View, "TextType" is always null.
example Razor:
When I checked the XML data in umbraco.config, I see that it is saving an empty string for all the TextType properties:
This seems like a bug... so I have logged it as an issue (http://issues.umbraco.org/issue/U4-11348) but I was wondering if anyone else had encountered it...?
Hi Heather
GetPropertyValue("TextType") - should this be GetPropertyValue("textType")
ie, lowercase t
Cheers
Nigel
Thank you for your response, Nigel, however my properties are title cased (I know I am peculiar). You can verify it in the umbraco.config sample I included. Just because stranger things have happened, I went ahead and re-ran my Razor test using your suggestion, but as I suspected, the value is still NULL.
It seems that an update to Umbraco v. 7.10.4 (and re-saving the nested content datatype in question) fixed this.
Hi Heather, just to follow up on this - the #U4-11184 patch did fix this issue. It was a long standing bug with Nested Content.
Thanks, Lee.
I've made an update to the issue, for future reference. :-)
Thanks for the bread crumbs! In my situation I'm still using the original .5 Nested Content package as it was too significant to move everything to Umbraco's Shipped NC, but I'm also on Umbraco 7.10.4
I had to add a new drop down, and was experiencing this issue where the value was always NULL. As a workaround to this issue, you can also manually modify the data type in the database to use the legacy drop down.
1) Go to Developer -> Data Types -> The Drop Down In Question
2) Note the ID /umbraco/#/developer/dataTypes/edit/123456
3) Open SSMS, cmsDataType table, find your data type and change the propertyEditorAlias to
Umbraco.DropDown
which I assume is the legacy drop down?4) Restart your app, resave content.
Hope that helps someone in a crunch.
is working on a reply...