Copied to clipboard

Flag this post as spam?

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


  • Andrew Munro 78 posts 161 karma points
    Mar 19, 2014 @ 16:17
    Andrew Munro
    0

    DropdownlistMultiplePublishKeys editor returns prevalue text if only one item is selected

    Hi There - I am trying to use the DropdownlistMultiplePublishKeys editor to categorize some nodes. Some nodes will have single categories while others may have multiple.

    The issue that I'm having is that if there are multiple prevalues selected, the value of the property is a comma seperated list as I was expecting. For single selections however, the property returns the prevalue text

    For example, If I've seelcted "Batteries, Beans, Wheat" in this editor the property value would be something like "62,75,85" which is what I'm wanting. If I only select "Batteries", the property value returns as "Batteries". Naturall, this makes it very difficult to a comparison amongst all nodes.

    Is there an easy way to guarantee that the prevalue ID is always returned?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 19, 2014 @ 16:25
  • Andrew Munro 78 posts 161 karma points
    Mar 19, 2014 @ 16:33
    Andrew Munro
    0

    Thank you for the reply. I suppose I could convert all prevalue ID's across the board into string and compare the strings however it seems like it would add more overhead that I would like. My goal is to take the few values that come in as strings and convert them to ID's. In the backend I don't really need or want to do string comparison. To give you a better idea of the issue. I've attached a value list. I've had to obfuscate some of the data but the value column shows what happens when I pull the value of a property with multiple selected items vs. one with a single selection.

    This is the code that I use to access this property and the output table.

    dn.GetProperty("linerApplications").Value
    SourceNameValueTime
    page Node:xxxxx1 22,25,26,27,28 3/19/2014 9:00:02 AM
    page Node:xxxxx2 18,21,22,25,26,27,28 3/19/2014 9:00:02 AM
    page Node:xxxxx3 19,21,23,28 3/19/2014 9:00:02 AM
    page Node:xxxxx4 Hides 3/19/2014 9:00:02 AM
    page Node:xxxxx5 18,20,29 3/19/2014 9:00:02 AM
  • Andrew Munro 78 posts 161 karma points
    Mar 19, 2014 @ 16:43
    Andrew Munro
    0

    My appologies. To clarify, I'm trying to convert all values to integers, not strings.

  • Maria del Valle Duhagon 6 posts 26 karma points
    Feb 02, 2015 @ 14:24
    Maria del Valle Duhagon
    0

    Hello,

    This is happening to me too using Umbraco 7. I can't understand why this would be an expected behavior,
    if I'm using 'dropdown list multiple publishing keys', I expect the component to always store the selected keys, be it one or more, and not a mix.....
    also I find it to be somewhat erratic, if I republish the nodes, sometimes the key gets sotred for elements with only one selected value, but then if I republish it or publish a sibiling node, the text for the key gets saved instead.

    Is there a way I can fix this? I want the key/id for the selected dropdown items to be saved in the content node, even if the selected item is only one.

     

Please Sign in or register to post replies

Write your reply to:

Draft