From de9c5b88ab670e05ab615444178a86d7fd8affe0 Mon Sep 17 00:00:00 2001 From: mikkelhm Date: Tue, 21 Mar 2017 11:48:50 +0100 Subject: [PATCH] Updates the legacy linkpicker to show udi links properly, i.e. translate them to nice internal urls --- .../src/views/common/dialogs/linkpicker.controller.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js index 3776b66529..5ee103a32b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js @@ -22,17 +22,19 @@ angular.module("umbraco").controller("Umbraco.Dialogs.LinkPickerController", $scope.target = dialogOptions.currentTarget; //if we have a node ID, we fetch the current node to build the form data - if ($scope.target.id) { + if ($scope.target.id || $scope.target.udi) { + + var id = $scope.target.udi ? $scope.target.udi : $scope.target.id; if (!$scope.target.path) { - entityResource.getPath($scope.target.id, "Document").then(function (path) { + entityResource.getPath(id, "Document").then(function (path) { $scope.target.path = path; //now sync the tree to this path $scope.dialogTreeEventHandler.syncTree({ path: $scope.target.path, tree: "content" }); }); } - contentResource.getNiceUrl($scope.target.id).then(function (url) { + contentResource.getNiceUrl(id).then(function (url) { $scope.target.url = url; }); }