Doctype validation on alias fails

As it tests if there is a type with alias, but doesnt check if its
itself, validation will never pass after initial save.
This commit is contained in:
Per Ploug
2016-01-13 14:28:44 +01:00
parent 849d7c45e0
commit 3eab76494e

View File

@@ -188,7 +188,12 @@ namespace Umbraco.Web.Editors
if (template == null)
{
template = new Template(ctSave.Name, ctSave.Alias);
template.Content = ViewHelper.GetDefaultFileContent(modelClassName: ctSave.Name.ToSafeAlias(false));
//ensure is safe and always pascal cased, per razor standard
var classname = ctSave.Name.ToSafeAlias(false);
classname = char.ToUpper(classname[0]) + classname.Substring(1);
template.Content = ViewHelper.GetDefaultFileContent(modelClassName: classname);
Services.FileService.SaveTemplate(template);
}