diff --git a/src/Umbraco.Core/ApplicationContext.cs b/src/Umbraco.Core/ApplicationContext.cs index 3634ae58ad..d6cf1c27d2 100644 --- a/src/Umbraco.Core/ApplicationContext.cs +++ b/src/Umbraco.Core/ApplicationContext.cs @@ -202,6 +202,14 @@ namespace Umbraco.Core } } + /// + /// If the db is configured and there is a database context, but we are not 'configured' , then it means we are upgrading + /// + public bool IsUpgrading + { + get { return IsConfigured == false && DatabaseContext != null && DatabaseContext.IsDatabaseConfigured; } + } + /// /// The original/first url that the web application executes /// diff --git a/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs b/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs index b9b8d478d2..dbb79443d9 100644 --- a/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs +++ b/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs @@ -39,8 +39,7 @@ namespace Umbraco.Web ""application"": { ""applicationPath"": """ + html.ViewContext.HttpContext.Request.ApplicationPath + @""" }, - //""isDebuggingEnabled"" : " + html.ViewContext.HttpContext.IsDebuggingEnabled.ToString().ToLowerInvariant() + @" - ""isDebuggingEnabled"" : false + ""isDebuggingEnabled"" : " + html.ViewContext.HttpContext.IsDebuggingEnabled.ToString().ToLowerInvariant() + @" }; "; diff --git a/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs b/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs index c1cff6a5aa..81ae20965c 100644 --- a/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs +++ b/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs @@ -36,9 +36,7 @@ namespace Umbraco.Web.Security.Identity if (userMembershipProvider == null) throw new ArgumentNullException("userMembershipProvider"); //Don't proceed if the app is not ready - if (appContext.IsConfigured == false - || appContext.DatabaseContext == null - || appContext.DatabaseContext.IsDatabaseConfigured == false) return; + if (appContext.IsUpgrading == false && appContext.IsConfigured == false) return; //Configure Umbraco user manager to be created per request app.CreatePerOwinContext( @@ -66,9 +64,7 @@ namespace Umbraco.Web.Security.Identity if (customUserStore == null) throw new ArgumentNullException("customUserStore"); //Don't proceed if the app is not ready - if (appContext.IsConfigured == false - || appContext.DatabaseContext == null - || appContext.DatabaseContext.IsDatabaseConfigured == false) return; + if (appContext.IsUpgrading == false && appContext.IsConfigured == false) return; //Configure Umbraco user manager to be created per request app.CreatePerOwinContext( @@ -94,9 +90,7 @@ namespace Umbraco.Web.Security.Identity if (userManager == null) throw new ArgumentNullException("userManager"); //Don't proceed if the app is not ready - if (appContext.IsConfigured == false - || appContext.DatabaseContext == null - || appContext.DatabaseContext.IsDatabaseConfigured == false) return; + if (appContext.IsUpgrading == false && appContext.IsConfigured == false) return; //Configure Umbraco user manager to be created per request app.CreatePerOwinContext(userManager);