Qite / Umbraco-Inception

A code first approach for Umbraco (7)
MIT License
26 stars 9 forks source link

Template path is null when creating new view in CreateMatchingView #11

Open JuJuBayatz opened 8 years ago

JuJuBayatz commented 8 years ago

In new version of Umbraco.Core constructor of Template class ignores first parameter (path). This causes a crash in CreateViewFile method in this line: string physicalViewFileLocation = HostingEnvironment.MapPath(template.Path);

Problem is in the constructor called prior to CreateViewFile call: currentTemplate = new Template(templatePath, attribute.ContentTypeName, attribute.ContentTypeAlias);

dmeineck commented 8 years ago

I second this issue, since upgrading from 7.2.8 to 7.3.3, new page types created since then with the createMatchingView constructor param on the UmbracoContentType attribute set to true, cause a NullReferenceException on the VirtualPath property. Setting the param value to false circumvents the problem, but I have to manually create and apply the template against the document type.