From c13b2fae4b6d1eb996cec65698321a5246bbfaf3 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 15 Jun 2017 00:04:42 +0200 Subject: [PATCH] Fixes issue of rendering the umb version in the html markup --- src/Umbraco.Web.UI.Client/src/app.js | 2 +- .../src/common/services/assets.service.js | 2 +- src/Umbraco.Web/Editors/BackOfficeController.cs | 3 ++- src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs | 3 +-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/app.js b/src/Umbraco.Web.UI.Client/src/app.js index 64f468712a..83e7d3d27b 100644 --- a/src/Umbraco.Web.UI.Client/src/app.js +++ b/src/Umbraco.Web.UI.Client/src/app.js @@ -39,7 +39,7 @@ angular.module("umbraco.viewcache", []) $delegate.get = function (url, config) { if (Umbraco.Sys.ServerVariables.application && url.startsWith("views/") && url.endsWith(".html")) { - var rnd = Umbraco.Sys.ServerVariables.application.version + "." + Umbraco.Sys.ServerVariables.application.cdf; + var rnd = Umbraco.Sys.ServerVariables.application.versionHash; var _op = (url.indexOf("?") > 0) ? "&" : "?"; url += _op + "umb__rnd=" + rnd; } diff --git a/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js b/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js index ff54c5c222..783a1ef1a7 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js @@ -50,7 +50,7 @@ angular.module('umbraco.services') return url; } - var rnd = Umbraco.Sys.ServerVariables.application.version + "." + Umbraco.Sys.ServerVariables.application.cdf; + var rnd = Umbraco.Sys.ServerVariables.application.versionHash; var _op = (url.indexOf("?") > 0) ? "&" : "?"; url = url + _op + "umb__rnd=" + rnd; return url; diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index f082e05c89..445853a367 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -756,8 +756,9 @@ namespace Umbraco.Web.Editors var version = UmbracoVersion.GetSemanticVersion().ToSemanticString(); + app.Add("versionHash", string.Format("{0}.{1}", version, ClientDependencySettings.Instance.Version).GenerateHash()); app.Add("version", version); - app.Add("cdf", ClientDependencySettings.Instance.Version); + //useful for dealing with virtual paths on the client side when hosted in virtual directories especially app.Add("applicationPath", HttpContext.Request.ApplicationPath.EnsureEndsWith('/')); diff --git a/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs b/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs index 1de50f5b71..bf404f24a5 100644 --- a/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs +++ b/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs @@ -52,8 +52,7 @@ namespace Umbraco.Web }, ""application"": { ""applicationPath"": """ + html.ViewContext.HttpContext.Request.ApplicationPath + @""", - ""version"": """ + version + @""", - ""cdf"": """ + ClientDependencySettings.Instance.Version + @""" + ""versionHash"": """ + string.Format("{0}.{1}", version, ClientDependencySettings.Instance.Version).GenerateHash() + @""" }, ""isDebuggingEnabled"" : " + html.ViewContext.HttpContext.IsDebuggingEnabled.ToString().ToLowerInvariant() + @" };