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:
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.
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)
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 ?
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.
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:
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.
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
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 ?
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.
Hi, just to say, this issue has now been fixed and will out be in the v1.5.2 release.
Thanks, Hendy
is working on a reply...