From 1f999d7e22d860cbe58cc02416467cdae97ad1fd Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 4 Apr 2013 05:02:55 -0200 Subject: [PATCH] Macros - bugfix & refactor access to Xml cache --- src/Umbraco.Web/umbraco.presentation/macro.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/umbraco.presentation/macro.cs b/src/Umbraco.Web/umbraco.presentation/macro.cs index e6b420347d..ea31d49e87 100644 --- a/src/Umbraco.Web/umbraco.presentation/macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/macro.cs @@ -769,7 +769,9 @@ namespace umbraco XmlDocument macroXml = null; // get master xml document - XmlDocument umbracoXml = umbraco.content.Instance.XmlContent; + var cache = UmbracoContext.Current.ContentCache.InnerCache as Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache; + if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); + XmlDocument umbracoXml = cache.GetXml(UmbracoContext.Current); macroXml = new XmlDocument(); macroXml.LoadXml(""); foreach (var prop in macro.Model.Properties)