From afca2e70bd44ae0c6a812fdfdd7ff0df4d68822c Mon Sep 17 00:00:00 2001 From: elitsa Date: Tue, 13 Aug 2019 14:17:14 +0200 Subject: [PATCH 01/15] Removing the MiniProfiler routes if solution is not in debug mode. --- .../Profiling/WebProfilerProvider.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Profiling/WebProfilerProvider.cs b/src/Umbraco.Web/Profiling/WebProfilerProvider.cs index ffd1871ecc..68e1555884 100644 --- a/src/Umbraco.Web/Profiling/WebProfilerProvider.cs +++ b/src/Umbraco.Web/Profiling/WebProfilerProvider.cs @@ -1,7 +1,10 @@ using System; +using System.Linq; using System.Threading; using System.Web; +using System.Web.Routing; using StackExchange.Profiling; +using Umbraco.Core.Configuration; namespace Umbraco.Web.Profiling { @@ -24,6 +27,19 @@ namespace Umbraco.Web.Profiling { // booting... _bootPhase = BootPhase.Boot; + + // Remove Mini Profiler routes when not in debug mode + if (GlobalSettings.DebugMode == false) + { + var prefix = MiniProfiler.Settings.RouteBasePath.Replace("~/", string.Empty); + + using (RouteTable.Routes.GetWriteLock()) + { + var routes = RouteTable.Routes.Where(x => x is Route r && r.Url.StartsWith(prefix)).ToList(); + foreach(var r in routes) + RouteTable.Routes.Remove(r); + } + } } /// @@ -118,4 +134,4 @@ namespace Umbraco.Web.Profiling } } } -} \ No newline at end of file +} From f829ac4e6cfc9c20af70f0ce90e6c7a44e0111e8 Mon Sep 17 00:00:00 2001 From: Tom Pipe Date: Fri, 2 Aug 2019 13:32:19 +0100 Subject: [PATCH 02/15] Ensure a media type correctly inherits it's selected parent (cherry picked from commit 28dd9aa081a93e4d65e9ebc15ee890ebcb2974f4) --- src/Umbraco.Web/Editors/MediaTypeController.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Editors/MediaTypeController.cs b/src/Umbraco.Web/Editors/MediaTypeController.cs index a258c987f2..830d25f5c6 100644 --- a/src/Umbraco.Web/Editors/MediaTypeController.cs +++ b/src/Umbraco.Web/Editors/MediaTypeController.cs @@ -145,9 +145,18 @@ namespace Umbraco.Web.Editors } public MediaTypeDisplay GetEmpty(int parentId) { - var ct = new MediaType(parentId) {Icon = "icon-picture"}; + IMediaType mt; + if (parentId != Constants.System.Root) + { + var parent = Services.ContentTypeService.GetMediaType(parentId); + mt = parent != null ? new MediaType(parent, string.Empty) : new MediaType(parentId); + } + else + mt = new MediaType(parentId); - var dto = Mapper.Map(ct); + mt.Icon = "icon-picture"; + + var dto = Mapper.Map(mt); return dto; } From ea591c87a257d0b80c18d5d20336baaa79106f1f Mon Sep 17 00:00:00 2001 From: Matt Brailsford Date: Thu, 18 Jul 2019 11:04:06 +0100 Subject: [PATCH 03/15] Fixes #5932, showing "Return to ListView" for new content (cherry picked from commit f3fc83fae6f13b906df466904a32ac4003a4169b) --- .../common/directives/components/content/edit.controller.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index 5bcab56f48..01e9b12c99 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -184,6 +184,10 @@ $scope.content = data; + if (data.isChildOfListView && data.trashed === false) { + $scope.page.listViewPath = $routeParams.page ? '/content/content/edit/' + data.parentId + '?page=' + $routeParams.page : '/content/content/edit/' + data.parentId; + } + init($scope.content); resetLastListPageNumber($scope.content); From 802e6d7979b521b2f6fc9ed78090fc1f348b4e31 Mon Sep 17 00:00:00 2001 From: Matt Brailsford Date: Thu, 18 Jul 2019 11:01:46 +0100 Subject: [PATCH 04/15] Fixes #5931, show breadcrumb for new content Could probably do with adding "Untitled" to translation file (cherry picked from commit 249126a2b5202e64c04b212a34fcea91b2260010) --- .../components/content/edit.controller.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index 01e9b12c99..db25399135 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -27,13 +27,18 @@ editorState.set($scope.content); //We fetch all ancestors of the node to generate the footer breadcrumb navigation - if (!$scope.page.isNew) { - if (content.parentId && content.parentId !== -1) { - entityResource.getAncestors(content.id, "document") - .then(function (anc) { - $scope.ancestors = anc; - }); + if (content.parentId && content.parentId !== -1) { + var ancestorIds = content.path.split(','); + ancestorIds.shift(); // Remove -1 + if ($scope.page.isNew) { + ancestorIds.pop(); // Remove 0 } + entityResource.getByIds(ancestorIds, 'document').then(function (anc) { + $scope.ancestors = anc; + if ($scope.page.isNew) { + $scope.ancestors.push({ name: "Untitled" }) + } + }); } evts.push(eventsService.on("editors.content.changePublishDate", function (event, args) { From ee2068de568255145be396dd32f3e1094537cbb6 Mon Sep 17 00:00:00 2001 From: elitsa Date: Wed, 14 Aug 2019 14:03:32 +0200 Subject: [PATCH 05/15] Removing legacy service --- .../umbraco/webservices/legacyAjaxCalls.asmx.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs index 1929477181..a29e44a92b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs @@ -36,19 +36,7 @@ namespace umbraco.presentation.webservices public class legacyAjaxCalls : UmbracoAuthorizedWebService { private User _currentUser; - - [WebMethod] - public bool ValidateUser(string username, string password) - { - if (ValidateCredentials(username, password)) - { - var u = new BusinessLogic.User(username); - BasePage.doLogin(u); - return true; - } - return false; - } - + /// /// method to accept a string value for the node id. Used for tree's such as python /// and xslt since the file names are the node IDs From 8e2eccb3925f0f6d19322a09d314d87263c31e30 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 15 Aug 2019 13:32:09 +0200 Subject: [PATCH 06/15] Bump version to 7.15.2 --- src/SolutionInfo.cs | 4 ++-- src/Umbraco.Core/Configuration/UmbracoVersion.cs | 2 +- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 3a85915cf5..ffaec90fa7 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -11,5 +11,5 @@ using System.Resources; [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyFileVersion("7.15.1")] -[assembly: AssemblyInformationalVersion("7.15.1")] +[assembly: AssemblyFileVersion("7.15.2")] +[assembly: AssemblyInformationalVersion("7.15.2")] diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs index f23078dbd0..b02e199313 100644 --- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs +++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs @@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration { public class UmbracoVersion { - private static readonly Version Version = new Version("7.15.1"); + private static readonly Version Version = new Version("7.15.2"); /// /// Gets the current version of Umbraco. diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 42f607d64e..4eddca0b8d 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -1028,9 +1028,9 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\" True True - 7151 + 7152 / - http://localhost:7151 + http://localhost:7152 False False From cd355910b390b1200e2037154ea19525476519a5 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 16 Aug 2019 15:34:49 +1000 Subject: [PATCH 07/15] strangely i need the fully qualified name here else i get an error, otherwise works great. --- src/Umbraco.Web/Profiling/WebProfilerProvider.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Profiling/WebProfilerProvider.cs b/src/Umbraco.Web/Profiling/WebProfilerProvider.cs index 68e1555884..e0dcfcf9b1 100644 --- a/src/Umbraco.Web/Profiling/WebProfilerProvider.cs +++ b/src/Umbraco.Web/Profiling/WebProfilerProvider.cs @@ -31,7 +31,8 @@ namespace Umbraco.Web.Profiling // Remove Mini Profiler routes when not in debug mode if (GlobalSettings.DebugMode == false) { - var prefix = MiniProfiler.Settings.RouteBasePath.Replace("~/", string.Empty); + //NOTE: Keep the global fully qualified name, for some reason without it I was getting null refs + var prefix = global::StackExchange.Profiling.MiniProfiler.Settings.RouteBasePath.Replace("~/", string.Empty); using (RouteTable.Routes.GetWriteLock()) { From 505b5410405bee415ea57cc9abf3e3a94f551e6c Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 16 Aug 2019 15:39:46 +1000 Subject: [PATCH 08/15] Removing the MiniProfiler routes if solution is not in debug mode. --- .../Profiling/WebProfilerProvider.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Profiling/WebProfilerProvider.cs b/src/Umbraco.Web/Profiling/WebProfilerProvider.cs index ffd1871ecc..e0dcfcf9b1 100644 --- a/src/Umbraco.Web/Profiling/WebProfilerProvider.cs +++ b/src/Umbraco.Web/Profiling/WebProfilerProvider.cs @@ -1,7 +1,10 @@ using System; +using System.Linq; using System.Threading; using System.Web; +using System.Web.Routing; using StackExchange.Profiling; +using Umbraco.Core.Configuration; namespace Umbraco.Web.Profiling { @@ -24,6 +27,20 @@ namespace Umbraco.Web.Profiling { // booting... _bootPhase = BootPhase.Boot; + + // Remove Mini Profiler routes when not in debug mode + if (GlobalSettings.DebugMode == false) + { + //NOTE: Keep the global fully qualified name, for some reason without it I was getting null refs + var prefix = global::StackExchange.Profiling.MiniProfiler.Settings.RouteBasePath.Replace("~/", string.Empty); + + using (RouteTable.Routes.GetWriteLock()) + { + var routes = RouteTable.Routes.Where(x => x is Route r && r.Url.StartsWith(prefix)).ToList(); + foreach(var r in routes) + RouteTable.Routes.Remove(r); + } + } } /// @@ -118,4 +135,4 @@ namespace Umbraco.Web.Profiling } } } -} \ No newline at end of file +} From 6e1314ae304a63b605ca62e87d74fdd3281eb1bb Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 16 Aug 2019 15:58:13 +1000 Subject: [PATCH 09/15] Removing legacy service --- .../umbraco/webservices/legacyAjaxCalls.asmx.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs index 1929477181..a29e44a92b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs @@ -36,19 +36,7 @@ namespace umbraco.presentation.webservices public class legacyAjaxCalls : UmbracoAuthorizedWebService { private User _currentUser; - - [WebMethod] - public bool ValidateUser(string username, string password) - { - if (ValidateCredentials(username, password)) - { - var u = new BusinessLogic.User(username); - BasePage.doLogin(u); - return true; - } - return false; - } - + /// /// method to accept a string value for the node id. Used for tree's such as python /// and xslt since the file names are the node IDs From defcb727f94301faa0b08496f88852bf75657791 Mon Sep 17 00:00:00 2001 From: elitsa Date: Fri, 16 Aug 2019 13:34:25 +0200 Subject: [PATCH 10/15] Add special checks and preview for svg files media files. --- .../media/umbmedianodeinfo.directive.js | 35 +++++++++++++++---- .../components/media/umb-media-node-info.html | 10 ++++-- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js index efdeceb78f..677dccf3bb 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js @@ -1,25 +1,29 @@ (function () { 'use strict'; - function MediaNodeInfoDirective($timeout, $location, eventsService, userService, dateHelper) { + function MediaNodeInfoDirective($timeout, $location, eventsService, userService, dateHelper, mediaHelper) { function link(scope, element, attrs, ctrl) { var evts = []; - + function onInit() { // If logged in user has access to the settings section // show the open anchors - if the user doesn't have // access, contentType is null, see MediaModelMapper scope.allowOpen = scope.node.contentType !== null; - + // get document type details scope.mediaType = scope.node.contentType; // set the media link initially setMediaLink(); + // make sure dates are formatted to the user's locale formatDatesToLocal(); + + // set media file extension initially + setMediaExtension(); } function formatDatesToLocal() { @@ -30,26 +34,43 @@ }); } - function setMediaLink(){ + function setMediaLink() { scope.nodeUrl = scope.node.mediaLink; } + function setMediaExtension() { + scope.node.extension = mediaHelper.getFileExtension(scope.nodeUrl); + } + scope.openMediaType = function (mediaType) { // remove first "#" from url if it is prefixed else the path won't work var url = "/settings/mediaTypes/edit/" + mediaType.id; $location.path(url); }; + scope.openSVG = function () { + var popup = window.open('', '_blank'); + var html = '' + + ''; + + popup.document.open(); + popup.document.write(html); + popup.document.close(); + } + // watch for content updates - reload content when node is saved, published etc. - scope.$watch('node.updateDate', function(newValue, oldValue){ - if(!newValue) { return; } - if(newValue === oldValue) { return; } + scope.$watch('node.updateDate', function (newValue, oldValue) { + if (!newValue) { return; } + if (newValue === oldValue) { return; } // Update the media link setMediaLink(); // Update the create and update dates formatDatesToLocal(); + + //Update the media file format + setMediaExtension(); }); //ensure to unregister from all events! diff --git a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html index 7cfcb835a5..5ee68e5cff 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html @@ -12,9 +12,15 @@ From 7a7adfb61fd6e008fd5a0b402d90ea983d1001a1 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com> Date: Sat, 17 Aug 2019 23:54:49 +0200 Subject: [PATCH 11/15] Fixed typo in "ng-container" --- .../src/views/components/media/umb-media-node-info.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html index 5ee68e5cff..3f71ae2d18 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html @@ -12,12 +12,12 @@