U4-4466 - 6.2-beta - Creating Member Type without Alias results in no viewable Member Types in back office

Created by Matt Muller 18 Mar 2014, 17:14:50 Updated by Shannon Deminick 19 Mar 2014, 22:50:53

Tried adding a custom member type using this code:

var customMemberType = new MemberType(1044); customMemberType.Name = "Custom Member Type"; applicationContext.Services.MemberTypeService.Save(customMemberType);

Above code does not fail but in the back office there is no base "Member" type any longer and no way to see my custom one to delete it - I do see both in the database though.

This does work though:

var customMemberType = new MemberType(1044); customMemberType.Name = "Custom Member Type"; customMemberType.Alias = "CustomMemberType"; applicationContext.Services.MemberTypeService.Save(customMemberType);

Did not test just passing in Alias with no name and did not test passing in no Name or Alias, but may be worth checking those scenarios too.

Additionally, the above second block of code does not "nest" my custom type under the type called "Member" in the tree. It is a sibling - not a huge deal.

Would also like some guidance on whether the above code is "correct" - I assume I should not be hard coding the 1044 and doing some sort of GetAll/Find code using name="Member" to get that Id. I assume this will come with the 6.2 documentation on the new Member stuff as a whole.

Regards, Matt

Comments

Sebastiaan Janssen 19 Mar 2014, 13:49:42

We currently don't allow nesting member types anyway, so just make it -1.

For now this is how it works indeed, give it both a name and an alias. In a future release we can add another nice convenience method so you can do something like:

var mts = Services.MemberTypeService; mts.CreateMemberType("My name", "myAlias"); mts.Save(mt);


Shannon Deminick 19 Mar 2014, 22:45:26

I've added validation to the member type repository so it will not let you try to save one with an empty alias.

We currently do not have "Create" methods on any of the content type services, we can add those in future releases if it is more convenient, though doing

var mts = new MemberType { Name = "my name", Alias = "myAlias" };

is pretty easy :) and that's all CreateMemberType would be doing anyways.


Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 6.2.0

Due in version: 7.1.0, 6.2.0

Sprint:

Story Points:

Cycle: