Doctype alias validation always fails

As it only checks if there is a doctype with the same alias, but does
not test if this doctype is the same as the one currently being saved.
This commit is contained in:
Per Ploug
2016-01-13 14:39:00 +01:00
parent 3698ad6164
commit 7386afcce6

View File

@@ -191,7 +191,7 @@ namespace Umbraco.Web.Editors
//Validate that there's no other ct with the same name
var exists = getContentTypeByAlias(contentTypeSave.Alias);
if (exists != null)
if (exists != null && exists.Id != ctId)
{
ModelState.AddModelError("Alias", "A content type with this alias already exists");
}