Copied to clipboard

Flag this post as spam?

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


  • Dustin Graves 2 posts 23 karma points
    Jun 18, 2015 @ 17:14
    Dustin Graves
    0

    DotNetCheckBoxPicker Relation Mapping Does Not Work

    I have had a whole lot of trouble with this. Here is my scenario:

    I have a list of projects and I want to relate them to other projects. So I have a DotNetCheckBoxPicker whose source is working correctly. I want this to be a bi-directional relationship.

    Here is my relation and picker:

    Project Relation

    Related Project Picker

    This seems simple enough to me. But when I attempt to save any selection of related projects on my project it does not save the relation.

    It does, however, save the relation if I switch the Save Format to CSV. But then it is loading based on CSV value and not on the relation.

    Edit: I reverted back to a simple XmlCheckBoxPicker and it still didn't work. I reverted back to 1.4.2 and it worked, although from what I gather it won't work for new items.

  • Hundebol 167 posts 314 karma points
    Jun 19, 2015 @ 08:04
    Hundebol
    0

    I too have experienced the same problems. Relations only in XML PrefetchList won't save in content. Downgraded to 1.4.1 and everything works (Umbraco 7.2.4)

    Best regards

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Jun 19, 2015 @ 09:45
    Hendy Racher
    0

    Hi, just been looking into this - the way relations behave was changed in the latest release such that they are now created based on the save value in a server side event (previously it was an API call). This change was made because new items don't yet have an ID, so couldn't create a relation until that new item had been saved and hence given an ID.

    I wonder if such a fix might work: when set to "Relations Only" a value is saved so it can be used in the server side relation mapping event, and then this event could clear that saved value ?

  • Dustin Graves 2 posts 23 karma points
    Jun 19, 2015 @ 12:08
    Dustin Graves
    1

    That sounds about right.

    From my look through the source, the problem seems to be that the server is looking at the relation table to save the mapping of the relation table. The "PickedKeys" property on the "Picker" class looks up the relations table for "Relations Only". This works well on the front end, but the same property is being used to save the relations themselves.

    I can't find where the picked values would actually be passed from the client to the server. The client explicitly passes null when "Relations Only" is set. Any relations existing don't get wiped out, and no new relations are saved.

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Jun 28, 2015 @ 17:19
    Hendy Racher
    101

    Hi, just to say, this issue has now been fixed and will out be in the v1.5.2 release.

    Thanks, Hendy

Please Sign in or register to post replies

Write your reply to:

Draft