I having problems on setting value to some properties in a member saved event or created events (I have tried both).
private void MemberService_Created(IMemberService sender, NewEventArgs<IMember> e)
{
var member = e.Entity;
if (member.IsNewEntity())
{
int mediaFolder = 1052;
//Umbraco.MultiNodeTreePicker NOT SAVED
member.SetValue("mediafolderid", mediaFolder);
//Media picker NOT SAVED tried as string or Int
member.SetValue("testfolderid", mediaFolder.ToString());
// This is saved
member.SetValue("umbracoMemberComments", "bou"+ mediaFolder.ToString());
//Not saved but this seems a know bug.
sender.AssignRole(member.Id, "Member");
//using sender or applicationcontext seems to work
ApplicationContext.Current.Services.MemberService.Save(member,false);
}
}
Is someone experienced that kind of behaviour ? Thanks
Member saved event
Hello,
I having problems on setting value to some properties in a member saved event or created events (I have tried both).
Is someone experienced that kind of behaviour ? Thanks
I'm not 100% but I think MultinodeTreePicker values are saved as comma delimited string of Node Id's
also, with the media picker value, I cannot see where you're setting memberFolder?
Thanks for you answer.
Yes it needs a comma delimited string like: https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/59667-SetValue-with-Multiple-Media-picker but I am saving only one id.
I removed the code of the memberfolder you should read mediaFolder.ToString().
Hi,
It looks like there is a bug with all custom properties in those events. I can't get or set the Value of those properties...
This should be due to a bug in this API linked to this issue: http://issues.umbraco.org/issue/U4-6366
Anyone has experience this ?
Hi MrFlo,
If this problem is actual for you, try to use:
Thanks, Alex
is working on a reply...