From 85aadd8e8b86058eed80e3c31379af088d388787 Mon Sep 17 00:00:00 2001 From: Bertrand Le Roy Date: Sun, 19 May 2013 17:28:19 -0700 Subject: [PATCH] #19728: ResourceManager.Include ignores debug path --HG-- branch : 1.x extra : rebase_source : 616d92673f0cf4a77ee9c0e2717b321197c0dcd3 --- src/Orchard/UI/Resources/ResourceManager.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Orchard/UI/Resources/ResourceManager.cs b/src/Orchard/UI/Resources/ResourceManager.cs index 17d7e77a9..7fa8ee080 100644 --- a/src/Orchard/UI/Resources/ResourceManager.cs +++ b/src/Orchard/UI/Resources/ResourceManager.cs @@ -131,7 +131,7 @@ namespace Orchard.UI.Resources { } public virtual RequireSettings Include(string resourceType, string resourcePath, string resourceDebugPath) { - return Include(resourceType, resourcePath, null, null); + return Include(resourceType, resourcePath, resourceDebugPath, null); } public virtual RequireSettings Include(string resourceType, string resourcePath, string resourceDebugPath, string relativeFromPath) { @@ -142,10 +142,14 @@ namespace Orchard.UI.Resources { throw new ArgumentNullException("resourcePath"); } + // ~/ ==> convert to absolute path (e.g. /orchard/..) if (VirtualPathUtility.IsAppRelative(resourcePath)) { - // ~/ ==> convert to absolute path (e.g. /orchard/..) resourcePath = VirtualPathUtility.ToAbsolute(resourcePath); } + if (resourceDebugPath != null && VirtualPathUtility.IsAppRelative(resourceDebugPath)) { + resourceDebugPath = VirtualPathUtility.ToAbsolute(resourceDebugPath); + } + resourcePath = FixPath(resourcePath, relativeFromPath); resourceDebugPath = FixPath(resourceDebugPath, relativeFromPath); return Require(resourceType, ToAppRelativePath(resourcePath)).Define(d => d.SetUrl(resourcePath, resourceDebugPath));