I need to perform some functionality after a user is created; sending some emails, updating some member properties, etc.
I registered my event handler with MemberService.Created += OnMemberCreated
Everything seems to be working fine except the property update. This is a simplified version of the code from my event handler:
IMember member = e.Entity;
member.SetValue("myProperty", "myValue");
sender.Save(member);
Problem is that the value never gets set. I know the code is working because it's actually from a static function that I'm using elsewhere, so the property name is correct, etc.
Is there something else I need to do in order to update it properly?
Thanks!
UPDATE:
Turns out that sender.Save(member) is indeed saving the member (and property) correctly with "myValue" but something afterwards is blanking out my property. Any ideas?
Cannot update Member property on Created event
Hello everyone,
I need to perform some functionality after a user is created; sending some emails, updating some member properties, etc. I registered my event handler with
MemberService.Created += OnMemberCreated
Everything seems to be working fine except the property update. This is a simplified version of the code from my event handler:
Problem is that the value never gets set. I know the code is working because it's actually from a static function that I'm using elsewhere, so the property name is correct, etc.
Is there something else I need to do in order to update it properly? Thanks!
UPDATE: Turns out that
sender.Save(member)
is indeed saving the member (and property) correctly with "myValue" but something afterwards is blanking out my property. Any ideas?Turns out this is a known bug, reported on March 05. http://issues.umbraco.org/issue/U4-6366
Another thread talking about the issue: https://our.umbraco.org/forum/developers/api-questions/63555-AssignRole-not-saving
Thanks Alejandro.
Please can everyone who is having this issue please vote for it in bug tracker:
http://issues.umbraco.org/issue/U4-6366
That should raise the priority of a potential fix.
(Please note, you may need to create a bug tracker account first)
is working on a reply...