diff --git a/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs b/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs index d419191f5b..4aa79358a3 100644 --- a/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs +++ b/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs @@ -201,8 +201,13 @@ namespace Umbraco.Web.Routing // time to read the alternate template alias, from querystring, form, cookie or server vars. // it will be cleared as soon as .PublishedContent change, because then it's not the // expected content anymore and the alternate template does not apply. + if (_umbracoContext.HttpContext.Items["altTemplate"] != null) + _publishedContentRequest.AlternateTemplateAlias = _umbracoContext.HttpContext.Items["altTemplate"].ToString(); + _publishedContentRequest.AlternateTemplateAlias = _umbracoContext.HttpContext.Request["altTemplate"]; + _umbracoContext.HttpContext.Trace.Write(string.Format("test {0}", _publishedContentRequest.AlternateTemplateAlias)); + // handle "not found", follow internal redirects, validate access, template // because these might loop, we have to have some sort of infinite loop detection int i = 0, j = 0; diff --git a/src/umbraco.businesslogic/Log.cs b/src/umbraco.businesslogic/Log.cs index 26dea86a32..ee29e4e157 100644 --- a/src/umbraco.businesslogic/Log.cs +++ b/src/umbraco.businesslogic/Log.cs @@ -87,8 +87,7 @@ namespace umbraco.BusinessLogic if (UmbracoSettings.DisabledLogTypes != null && UmbracoSettings.DisabledLogTypes.SelectSingleNode(String.Format("//logTypeAlias [. = '{0}']", type.ToString().ToLower())) == null) { - - if (comment.Length > 3999) + if (comment != null && comment.Length > 3999) comment = comment.Substring(0, 3955) + "..."; if (UmbracoSettings.EnableAsyncLogging)