From d821401ea2dae1d3db8105cf0f114ea4b9243450 Mon Sep 17 00:00:00 2001 From: neehouse Date: Fri, 6 Sep 2013 15:34:19 -0400 Subject: [PATCH] Removing file location restriction from PartialViewMacro to allow custom paths. --- src/Umbraco.Web/Macros/PartialViewMacroEngine.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs b/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs index e454a99f17..3e819a737d 100644 --- a/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs +++ b/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs @@ -104,11 +104,11 @@ namespace Umbraco.Web.Macros if (currentPage == null) throw new ArgumentNullException("currentPage"); if (macro.ScriptName.IsNullOrWhiteSpace()) throw new ArgumentException("The ScriptName property of the macro object cannot be null or empty"); - if (!macro.ScriptName.StartsWith(SystemDirectories.MvcViews + "/MacroPartials/") - && (!Regex.IsMatch(macro.ScriptName, "~/App_Plugins/.+?/Views/MacroPartials", RegexOptions.Compiled))) - { - throw new InvalidOperationException("Cannot render the Partial View Macro with file: " + macro.ScriptName + ". All Partial View Macros must exist in the " + SystemDirectories.MvcViews + "/MacroPartials/ folder"); - } + //if (!macro.ScriptName.StartsWith(SystemDirectories.MvcViews + "/MacroPartials/") + // && (!Regex.IsMatch(macro.ScriptName, "~/App_Plugins/.+?/Views/MacroPartials", RegexOptions.Compiled))) + //{ + // throw new InvalidOperationException("Cannot render the Partial View Macro with file: " + macro.ScriptName + ". All Partial View Macros must exist in the " + SystemDirectories.MvcViews + "/MacroPartials/ folder"); + //} var http = _getHttpContext(); var umbCtx = _getUmbracoContext();