From 5ada85df29dee4793eff496d70e674b881c07e85 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 5 Jul 2019 12:11:03 +0200 Subject: [PATCH 1/7] Provide the correct assembly redirects --- build/NuSpecs/tools/Web.config.install.xdt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build/NuSpecs/tools/Web.config.install.xdt b/build/NuSpecs/tools/Web.config.install.xdt index 4f8a1927a8..f0d194d341 100644 --- a/build/NuSpecs/tools/Web.config.install.xdt +++ b/build/NuSpecs/tools/Web.config.install.xdt @@ -346,7 +346,7 @@ - + @@ -358,11 +358,11 @@ - + - + @@ -370,27 +370,27 @@ - + - + - + - + - + - + From 80d7f1b2c99eb0332446e70170ebe78bbb44e160 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sun, 7 Jul 2019 11:36:26 +0200 Subject: [PATCH 2/7] Make it possible to save a member without resetting the password --- .../src/views/member/member.edit.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js index 339358dbf2..eb99e46a1f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js @@ -133,7 +133,7 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS //anytime a user is changing a member's password without the oldPassword, we are in effect resetting it so we need to set that flag here var passwordProp = _.find(contentEditingHelper.getAllProps($scope.content), function (e) { return e.alias === '_umb_password' }); - if (!passwordProp.value.reset) { + if (passwordProp && passwordProp.value && !passwordProp.value.reset) { //so if the admin is not explicitly resetting the password, flag it for resetting if a new password is being entered passwordProp.value.reset = !passwordProp.value.oldPassword && passwordProp.config.allowManuallyChangingPassword; } From 1073e6257c56f8cd118e09695468d43c4616be2a Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sat, 13 Jul 2019 14:48:35 +0200 Subject: [PATCH 3/7] Adjust comments --- .../common/overlays/linkpicker/linkpicker.controller.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js index 2b6b77ed41..d9f907eacc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js @@ -28,24 +28,23 @@ angular.module("umbraco").controller("Umbraco.Overlays.LinkPickerController", if (dialogOptions.currentTarget) { // clone the current target so we don't accidentally update the caller's model while manipulating $scope.model.target $scope.model.target = angular.copy(dialogOptions.currentTarget); - //if we have a node ID, we fetch the current node to build the form data + // if we have a node ID, we fetch the current node to build the form data if ($scope.model.target.id || $scope.model.target.udi) { - //will be either a udi or an int + // will be either a udi or an int var id = $scope.model.target.udi ? $scope.model.target.udi : $scope.model.target.id; // is it a content link? if (!$scope.model.target.isMedia) { // get the content path entityResource.getPath(id, "Document").then(function (path) { - //now sync the tree to this path + // now sync the tree to this path $scope.dialogTreeEventHandler.syncTree({ path: path, tree: "content" }); }); - entityResource.getUrlAndAnchors(id).then(function(resp){ $scope.anchorValues = resp.anchorValues; $scope.model.target.url = resp.url; From 82eb241119a39f4ee49283538c562241dca6e326 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sat, 13 Jul 2019 14:49:05 +0200 Subject: [PATCH 4/7] Add overload method for Udi --- src/Umbraco.Web/Editors/EntityController.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs index 85d5b607b6..ada0206545 100644 --- a/src/Umbraco.Web/Editors/EntityController.cs +++ b/src/Umbraco.Web/Editors/EntityController.cs @@ -56,6 +56,7 @@ namespace Umbraco.Web.Editors //id is passed in eventually we'll probably want to support GUID + Udi too new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetPagedChildren", "id", typeof(int), typeof(string)), new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetPath", "id", typeof(int), typeof(Guid), typeof(Udi)), + new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetUrlAndAnchors", "id", typeof(int), typeof(Guid), typeof(Udi)), new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetById", "id", typeof(int), typeof(Guid), typeof(Udi)), new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetByIds", "ids", typeof(int[]), typeof(Guid[]), typeof(Udi[])))); } @@ -281,9 +282,17 @@ namespace Umbraco.Web.Editors publishedContentExists: i => Umbraco.TypedContent(i) != null); } + [HttpGet] + public UrlAndAnchors GetUrlAndAnchors(Udi id) + { + var nodeId = Umbraco.GetIdForUdi(id); + var url = Umbraco.Url(nodeId); + var anchorValues = Services.ContentService.GetAnchorValuesFromRTEs(nodeId); + return new UrlAndAnchors(url, anchorValues); + } [HttpGet] - public UrlAndAnchors GetUrlAndAnchors([FromUri]int id) + public UrlAndAnchors GetUrlAndAnchors(int id) { var url = Umbraco.Url(id); var anchorValues = Services.ContentService.GetAnchorValuesFromRTEs(id); From 7c03fe3c1f4e963f1e68e32968aef39ca577beeb Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sat, 13 Jul 2019 14:49:35 +0200 Subject: [PATCH 5/7] Adjust parameter --- .../src/common/resources/entity.resource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js index c85a85bb57..9453ca8c41 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js @@ -172,7 +172,7 @@ function entityResource($q, $http, umbRequestHelper) { umbRequestHelper.getApiUrl( "entityApiBaseUrl", "GetUrlAndAnchors", - { id: id })), + [{ id: id }])), 'Failed to retrieve url and anchors data for id ' + id); }, From de9241bcf592ca9994810d43232545844fc06848 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sat, 13 Jul 2019 14:50:25 +0200 Subject: [PATCH 6/7] Add UmbracoHelper overload methods to get url by guid --- src/Umbraco.Web/UmbracoHelper.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index c00d37f216..2c7cafb298 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -502,6 +502,16 @@ namespace Umbraco.Web return UrlProvider.GetUrl(contentId); } + /// + /// Gets the url of a content identified by its identifier. + /// + /// The content identifier. + /// The url for the content. + public string Url(Guid contentGuid) + { + return UrlProvider.GetUrl(contentGuid); + } + /// /// Gets the url of a content identified by its identifier, in a specified mode. /// @@ -513,6 +523,17 @@ namespace Umbraco.Web return UrlProvider.GetUrl(contentId, mode); } + /// + /// Gets the url of a content identified by its identifier, in a specified mode. + /// + /// The content identifier. + /// The mode. + /// The url for the content. + public string Url(Guid contentGuid, UrlProviderMode mode) + { + return UrlProvider.GetUrl(contentGuid, mode); + } + /// /// This method will always add the domain to the path if the hostnames are set up correctly. /// From c47a08b5532aa3b858ec2cfbe3daa2f09b7bf4f6 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sat, 13 Jul 2019 16:40:01 +0200 Subject: [PATCH 7/7] Add overload for NiceUrl --- src/Umbraco.Web/UmbracoHelper.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index 2c7cafb298..46ae098e2e 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -492,6 +492,18 @@ namespace Umbraco.Web return Url(nodeId); } + /// + /// Returns a string with a friendly url from a node. + /// IE.: Instead of having /482 (id) as an url, you can have + /// /screenshots/developer/macros (spoken url) + /// + /// Identifier for the node that should be returned + /// String with a friendly url from a node + public string NiceUrl(Guid guid) + { + return Url(guid); + } + /// /// Gets the url of a content identified by its identifier. ///