From 39f3c377be09c76a36fe9be6bd1db9d3f515fe35 Mon Sep 17 00:00:00 2001 From: hartvig Date: Fri, 6 Jan 2012 08:32:50 -0100 Subject: [PATCH] Work items: 30660 --- umbraco/presentation/App_Data/Umbraco.sdf | Bin 20480 -> 20480 bytes umbraco/presentation/config/Dashboard.config | 18 ++-- .../presentation/config/UrlRewriting.config | 1 + .../presentation/config/metablogConfig.config | 2 +- .../presentation/config/restExtensions.config | 4 - .../presentation/config/xsltExtensions.config | 2 - umbraco/presentation/macro.cs | 77 ++++++++++-------- umbraco/presentation/web.config | 4 +- .../web.config.UMBRACOHUMMER.xslt | 2 +- 9 files changed, 62 insertions(+), 48 deletions(-) diff --git a/umbraco/presentation/App_Data/Umbraco.sdf b/umbraco/presentation/App_Data/Umbraco.sdf index 90935a7f0b42847f1a5892b30dcfce1d172cf218..a4ad7651d4afc3d00ec7d63952aff739fd78e400 100644 GIT binary patch delta 92 zcmZozz}T>Wk;T14pk^YA2_xf1%j1lu-`f}&5-k}Rc%m5?qL~>OQZ9QlOy^->ID5>S q0R%woYB2_eNT8goBm;vpkiC6kpfKBSKX-<8`!@>;Y~o!c-~a$1ixzVL delta 59 zcmZozz}T>WkwxZlXTU@j6Gn!Omd6< /umbraco/dashboard/startupdashboardkits.ascx - - editor - writer - - + editorwriter /umbraco/dashboard/startupdashboardvideos.ascx @@ -103,4 +99,16 @@ /umbraco/plugins/uGoLive/Dashboard.ascx +
+ + default + content + + + /usercontrols/dashboards/ContactForm_logs.ascx + + + /usercontrols/dashboards/EmailAFriendForm_logs.ascx + +
\ No newline at end of file diff --git a/umbraco/presentation/config/UrlRewriting.config b/umbraco/presentation/config/UrlRewriting.config index 020f541879..82343ba4e7 100644 --- a/umbraco/presentation/config/UrlRewriting.config +++ b/umbraco/presentation/config/UrlRewriting.config @@ -30,5 +30,6 @@ --> + \ No newline at end of file diff --git a/umbraco/presentation/config/metablogConfig.config b/umbraco/presentation/config/metablogConfig.config index 585ebd0bf5..adf71d17d0 100644 --- a/umbraco/presentation/config/metablogConfig.config +++ b/umbraco/presentation/config/metablogConfig.config @@ -5,7 +5,7 @@ 0 1080 False - umbBlog + Base diff --git a/umbraco/presentation/config/restExtensions.config b/umbraco/presentation/config/restExtensions.config index 88aa956085..991dde0bc7 100644 --- a/umbraco/presentation/config/restExtensions.config +++ b/umbraco/presentation/config/restExtensions.config @@ -10,8 +10,4 @@ --> - - - - \ No newline at end of file diff --git a/umbraco/presentation/config/xsltExtensions.config b/umbraco/presentation/config/xsltExtensions.config index e83c1dea04..21f1b80526 100644 --- a/umbraco/presentation/config/xsltExtensions.config +++ b/umbraco/presentation/config/xsltExtensions.config @@ -2,6 +2,4 @@ - - \ No newline at end of file diff --git a/umbraco/presentation/macro.cs b/umbraco/presentation/macro.cs index 5e094deb4d..0e411e9dc3 100644 --- a/umbraco/presentation/macro.cs +++ b/umbraco/presentation/macro.cs @@ -232,29 +232,29 @@ namespace umbraco string GetCacheIdentifier(MacroModel model, Hashtable pageElements, int pageId) { - StringBuilder id = new StringBuilder(); + StringBuilder id = new StringBuilder(); - var alias = string.IsNullOrEmpty(model.ScriptCode) ? model.Alias : Macro.GenerateCacheKeyFromCode(model.ScriptCode); - id.AppendFormat("{0}-", alias); + var alias = string.IsNullOrEmpty(model.ScriptCode) ? model.Alias : Macro.GenerateCacheKeyFromCode(model.ScriptCode); + id.AppendFormat("{0}-", alias); if (CacheByPage) { - id.AppendFormat("{0}-", pageId); + id.AppendFormat("{0}-", pageId); } if (CacheByPersonalization) { - var currentMember = Member.GetCurrentMember(); - id.AppendFormat("m{0}-", currentMember == null ? 0 : currentMember.Id); + var currentMember = Member.GetCurrentMember(); + id.AppendFormat("m{0}-", currentMember == null ? 0 : currentMember.Id); } - foreach (MacroPropertyModel prop in model.Properties) + foreach (MacroPropertyModel prop in model.Properties) { var propValue = prop.Value; - id.AppendFormat("{0}-", propValue.Length <= 255 ? propValue : propValue.Substring(0, 255)); + id.AppendFormat("{0}-", propValue.Length <= 255 ? propValue : propValue.Substring(0, 255)); } - return id.ToString(); + return id.ToString(); } public Control renderMacro(Hashtable attributes, Hashtable pageElements, int pageId) @@ -291,20 +291,20 @@ namespace umbraco if (!String.IsNullOrEmpty(macroHtml)) { UmbracoContext.Current.Trace.Write("renderMacro", - string.Format("Macro Content loaded from cache '{0}'.", Model.CacheIdentifier)); + string.Format("Macro Content loaded from cache '{0}'.", Model.CacheIdentifier)); } } else { - var cacheContent = macroCache["macroControl_" + Model.CacheIdentifier] as MacroCacheContent; + var cacheContent = macroCache["macroControl_" + Model.CacheIdentifier] as MacroCacheContent; - if (cacheContent != null) + if (cacheContent != null) { macroControl = cacheContent.Content; macroControl.ID = cacheContent.ID; UmbracoContext.Current.Trace.Write("renderMacro", - string.Format("Macro Control loaded from cache '{0}'.", Model.CacheIdentifier)); + string.Format("Macro Control loaded from cache '{0}'.", Model.CacheIdentifier)); } } } @@ -440,9 +440,9 @@ namespace umbraco if (!(macroControl is LiteralControl)) macroControl = new LiteralControl(sw.ToString()); - UmbracoContext.Current.Trace.Write("renderMacro", - string.Format("Macro Content saved to cache '{0}'.", Model.CacheIdentifier)); - } + UmbracoContext.Current.Trace.Write("renderMacro", + string.Format("Macro Content saved to cache '{0}'.", Model.CacheIdentifier)); + } } else { @@ -452,9 +452,9 @@ namespace umbraco CacheItemPriority.Low, null); - UmbracoContext.Current.Trace.Write("renderMacro", - string.Format("Macro Control saved to cache '{0}'.", Model.CacheIdentifier)); - } + UmbracoContext.Current.Trace.Write("renderMacro", + string.Format("Macro Control saved to cache '{0}'.", Model.CacheIdentifier)); + } } } } @@ -1122,9 +1122,13 @@ namespace umbraco } object propValue = mp.Value; + bool propValueSet = false; // Special case for types of webControls.unit if (prop.PropertyType == typeof(Unit)) + { propValue = Unit.Parse(propValue.ToString()); + propValueSet = true; + } else { try @@ -1144,6 +1148,8 @@ namespace umbraco propValue = parseResult; else propValue = false; + propValueSet = true; + } else { @@ -1154,26 +1160,29 @@ namespace umbraco try { propValue = Convert.ChangeType(propValue, st); + propValueSet = true; } catch (FormatException) { propValue = Convert.ChangeType(propValue, propType); + propValueSet = true; } } - else + /* NH 06-01-2012: Remove the lines below as they would only get activated if the values are empty + else + { + if (propType != null) { - if (propType != null) + if (propType.IsValueType) { - if (propType.IsValueType) - { - propValue = Activator.CreateInstance(propType); - } - else - { - propValue = null; - } + propValue = Activator.CreateInstance(propType); + } + else + { + propValue = null; } } + }*/ } if (GlobalSettings.DebugMode) @@ -1194,7 +1203,9 @@ namespace umbraco } } - prop.SetValue(control, Convert.ChangeType(propValue, prop.PropertyType), null); + // NH 06-01-2012: Only set value if it has content + if (propValueSet) + prop.SetValue(control, Convert.ChangeType(propValue, prop.PropertyType), null); } } @@ -1481,7 +1492,7 @@ namespace umbraco value = reader.GetString(columnName); return true; } - + value = string.Empty; return false; } @@ -1494,7 +1505,7 @@ namespace umbraco value = reader.GetInt(columnName); return true; } - + value = -1; return false; } @@ -1507,7 +1518,7 @@ namespace umbraco value = reader.GetBoolean(columnName); return true; } - + value = false; return false; } diff --git a/umbraco/presentation/web.config b/umbraco/presentation/web.config index c7acda515f..67b49a6f40 100644 --- a/umbraco/presentation/web.config +++ b/umbraco/presentation/web.config @@ -39,8 +39,8 @@ - - + + diff --git a/umbraco/presentation/web.config.UMBRACOHUMMER.xslt b/umbraco/presentation/web.config.UMBRACOHUMMER.xslt index 609814cb3b..304894bd1e 100644 --- a/umbraco/presentation/web.config.UMBRACOHUMMER.xslt +++ b/umbraco/presentation/web.config.UMBRACOHUMMER.xslt @@ -8,7 +8,7 @@ - 4.7.0 + 4.7.1