Implements: #U4-1770 - no more umbracoDebugMode, will use the compilation setting in the web.config

This commit is contained in:
Shannon
2013-06-21 16:20:18 +10:00
parent c81cd0fd1d
commit ed1aee5047
6 changed files with 17 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Web.Hosting;
using System.Web.Routing;
using System.Xml;
using System.Xml.Linq;
@@ -331,7 +332,13 @@ namespace Umbraco.Core.Configuration
{
try
{
return bool.Parse(ConfigurationManager.AppSettings["umbracoDebugMode"]);
if (HttpContext.Current != null)
{
return HttpContext.Current.IsDebuggingEnabled;
}
//go and get it from config directly
var section = ConfigurationManager.GetSection("system.web/compilation") as CompilationSection;
return section != null && section.Debug;
}
catch
{

View File

@@ -15,7 +15,6 @@
<add key="umbracoHideTopLevelNodeFromPath" value="true"/>
<add key="umbracoEditXhtmlMode" value="true"/>
<add key="umbracoUseDirectoryUrls" value="false"/>
<add key="umbracoDebugMode" value="true"/>
<add key="umbracoTimeOutInMinutes" value="20"/>
<add key="umbracoVersionCheckPeriod" value="7"/>
<add key="umbracoDisableXsltExtensions" value="true"/>
@@ -81,6 +80,7 @@
</system.data>
<system.web>
<compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.0"></compilation>
<!--<trust level="Medium" originUrl=".*"/>-->
<!-- Sitemap provider-->
<siteMap defaultProvider="UmbracoSiteMapProvider" enabled="true">

View File

@@ -32,6 +32,12 @@ namespace Umbraco.Tests
}
[Test]
public void Is_Debug_Mode()
{
Assert.That(Umbraco.Core.Configuration.GlobalSettings.DebugMode, Is.EqualTo(true));
}
[Ignore]
[Test]
public void Is_Version_From_Assembly_Correct()

View File

@@ -10,7 +10,7 @@ NOTES:
* Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config
* A new version will invalidate both client and server cache and create new persisted files
-->
<clientDependency version="12" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco">
<clientDependency version="13" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco">
<!--
This section is used for Web Forms only, the enableCompositeFiles="true" is optional and by default is set to true.

View File

@@ -14,8 +14,7 @@
value=""/>
<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoConfigurationStatus"
value=""/>
<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoDebugMode"
value="false"/>
</appSettings>
<system.web>

View File

@@ -38,7 +38,6 @@
<add key="umbracoHideTopLevelNodeFromPath" value="true" />
<add key="umbracoEditXhtmlMode" value="true" />
<add key="umbracoUseDirectoryUrls" value="false" />
<add key="umbracoDebugMode" value="true" />
<add key="umbracoTimeOutInMinutes" value="20" />
<add key="umbracoVersionCheckPeriod" value="7" />
<add key="umbracoDisableXsltExtensions" value="true" />