Is it impossible to set the MemberType of a Member from code in 6.1.6?
I am trying to create new Members using different MemberTypes on my Umbraco 6.1.6 site, but it seems determined to only create them with the default member type, regardless of whether I use the .Net or deprecated Umbraco way of doing things.
This SO Question indicates that it is only possible to have one default MemberType and there is no way to create a Member of any different type through code, but that seems ridiculous.
Ridiculous though it is, I can't find anything showing that it is wrong and - as usual - the Umbraco documentation confesses to being out of date and in need of updating. I'm using this as an alternative to changing the MemberType of an existing Member, which also appears to be against the rules.
Is it actually impossible to create members of more than one type? If not, can anyone offer any guidance as to how to do it?
Chaging a member type of an existing member I believe you are right, that's not supported.
But I've not had any problems creating one of a particular type, using something like:
var mt = MemberType.GetByAlias("MyMemberType");
var user = new User(0); // admin user
member = Member.MakeNew(name, loginName, email, mt, user);
member.Save();
member.XmlGenerate(new XmlDocument());
Member.AddMemberToCache(member);
Is it impossible to set the MemberType of a Member from code in 6.1.6?
I am trying to create new Members using different MemberTypes on my Umbraco 6.1.6 site, but it seems determined to only create them with the default member type, regardless of whether I use the .Net or deprecated Umbraco way of doing things.
This SO Question indicates that it is only possible to have one default MemberType and there is no way to create a Member of any different type through code, but that seems ridiculous.
Ridiculous though it is, I can't find anything showing that it is wrong and - as usual - the Umbraco documentation confesses to being out of date and in need of updating. I'm using this as an alternative to changing the MemberType of an existing Member, which also appears to be against the rules.
Is it actually impossible to create members of more than one type? If not, can anyone offer any guidance as to how to do it?
Chaging a member type of an existing member I believe you are right, that's not supported.
But I've not had any problems creating one of a particular type, using something like:
is working on a reply...