From 195953d63c76d0c17dfc6393f434dd58aa9ca37a Mon Sep 17 00:00:00 2001 From: Tom Fulton Date: Wed, 15 Jul 2015 16:59:09 -0600 Subject: [PATCH 1/2] Fix backoffice breaking when Actions use code in their JsSource - U4-6843 This reverts/refactors this pull request: https://github.com/umbraco/Umbraco-CMS/pull/722/files Since JsSource can be used for a file path or actual javascript, we can't use IOHelper.ResolveUrl here. Instead we're moving it to the GetLegacyActionJs() method, which already handles deciding if it's a code or a URL. :poop: --- src/Umbraco.Web/Editors/BackOfficeController.cs | 2 +- src/umbraco.cms/Actions/Action.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index ea4a21d840..c6617293f1 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -715,7 +715,7 @@ namespace Umbraco.Web.Editors if (isValid) { //it is a valid URL add to Url list - urlList.Add(jsFile); + urlList.Add(IOHelper.ResolveUrl(jsFile)); } } else diff --git a/src/umbraco.cms/Actions/Action.cs b/src/umbraco.cms/Actions/Action.cs index 72f06b8445..df6c257396 100644 --- a/src/umbraco.cms/Actions/Action.cs +++ b/src/umbraco.cms/Actions/Action.cs @@ -90,7 +90,7 @@ namespace umbraco.BusinessLogic.Actions { return ActionsResolver.Current.Actions .Where(x => !string.IsNullOrWhiteSpace(x.JsSource)) - .Select(x => IOHelper.ResolveUrl(x.JsSource)).ToList(); + .Select(x => x.JsSource).ToList(); //return ActionJsReference; } From 28df1af2261336db146c0582a419b104ef0ec437 Mon Sep 17 00:00:00 2001 From: Tom Fulton Date: Wed, 15 Jul 2015 23:42:42 -0600 Subject: [PATCH 2/2] Check for ~/ before using IOHelper.ResolveUrl An "relative virtual path" exception can be thrown by a path like "umbraco/test.js" --- src/Umbraco.Web/Editors/BackOfficeController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index c6617293f1..ae79798f54 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -715,7 +715,7 @@ namespace Umbraco.Web.Editors if (isValid) { //it is a valid URL add to Url list - urlList.Add(IOHelper.ResolveUrl(jsFile)); + urlList.Add(jsFile.StartsWith("~/") ? IOHelper.ResolveUrl(jsFile) : jsFile); } } else