U4-2136 - Multiple doc types with same Alias

Created by Rune Grønkjær 22 Apr 2013, 13:51:25 Updated by Rune Grønkjær 23 Apr 2013, 07:37:45

We have updated a website from Umbraco v4.11 to v6.0.3 and are now experiencing changed behaviour from our doc types.

We have two sites running in the solution and both have their own doc types. Several doc types have identical Aliases and almost the same properties. The doc types with identical aliases will have the one inheriting from the other.

This worked perfectly in Umbraco 4.11, but now, in v6, we're having problems creating nodes with the doc type that inherits from it's "twin" doc type. We choose the correct doc type in the drop down, but the node created has the doc type of the twin. The twin doc type is not even allowed.

Why we're doing it like that is because the two sites share a bunch of macros. These macros selects nodes using the Aliases. This will be problematic/ugly if we had to select on two different aliases each time.

Kind regards Rune

Comments

Morten Christensen 23 Apr 2013, 04:50:19

I have always been under the impression that doc type aliases should be unique, but will have to double check. Actually thought there was a validation of this upon creating the doc types.


Rune Grønkjær 23 Apr 2013, 05:59:05

It worked absolutely perfectly and I believe my scenario is completely valid. In my opinion I can't really see why it shouldn't be possible. It's "just" an alias used to name the type of a specific node. The two twin nodes are just the same type, with minor variations.


Morten Christensen 23 Apr 2013, 07:29:08

How did you actually go about creating two document types with the same alias? If I create a DocumentType and call it 'Article' and then create another DocumentType and also call it 'Article' there is a validation check in the create dialog box that checks if a DocumentType with the entered name/alias exists - if one already exists its invalid and you can't create it.

This piece of code has always been present (fire upon clicking create in the DocumentType create-dialog): protected void validationDoctypeName(object sender, ServerValidateEventArgs e) { if (DocumentType.GetByAlias(rename.Text) != null) e.IsValid = false; }

There are various scenarios where the alias is used and having duplicate aliases would cause problems, like when you install a package.

Sorry, but I don't agree that its valid scenario. It sounds more like a hack to use/re-use some macros. You could use a naming convention within the context of the two sites, so the alias doesn't become an issue when selecting nodes on the two different sites.


Rune Grønkjær 23 Apr 2013, 07:37:45

Fair enough. I will work around it then.

About how I did it. I just created the in the UI like always. No magic involved. First I create the one, and then I create the other, with a different Name. Finally I rename the Alias of the second doc type.

If that's not supposed to be possible, maybe that's the bug instead :)

BTW. it takes forever to change the Alias of a doc type on my website containing just about 3000 nodes. ;)


Priority: Normal

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:

Sprint:

Story Points:

Cycle: