Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Heather Floyd 435 posts 512 karma points c-trib
    5 days ago
    Heather Floyd
    0

    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>
    

    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...?

  • Nigel Wilson 811 posts 1737 karma points
    5 days ago
    Nigel Wilson
    0

    Hi Heather

    GetPropertyValue("TextType") - should this be GetPropertyValue("textType")

    ie, lowercase t

    Cheers

    Nigel

  • Heather Floyd 435 posts 512 karma points c-trib
    5 days ago
    Heather Floyd
    0

    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.

  • Heather Floyd 435 posts 512 karma points c-trib
    5 days ago
    Heather Floyd
    100

    It seems that an update to Umbraco v. 7.10.4 (and re-saving the nested content datatype in question) fixed this.

Please Sign in or register to post replies

Write your reply to:

Draft