From 6772b1de35a9903b3d650f4b4cea34a318c49ea0 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Sat, 25 Mar 2017 13:45:57 +0000 Subject: [PATCH] MNTP Content Picker - when rendering using the DocumentType Editor, querying for the 'startNodeId' is unrequired and could throw exceptions. This would patch would resolve the following issues... - U4-7602 - "7.4 Data Types with xpath queries specified caused Document Type edit/creation issues." - U4-8098 - "Content Type editor can fail while rendering" - U4-8900 - "XPath: "$current" on Multinodetreepicker gives error in Document Type editor" --- .../contentpicker/contentpicker.controller.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js index 667dfd0f22..9858240488 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js @@ -131,8 +131,11 @@ function contentPickerController($scope, dialogService, entityResource, editorSt } - //if we have a query for the startnode, we will use that. - if ($scope.model.config.startNode.query) { + if ($routeParams.section === "settings" && $routeParams.tree === "documentTypes") { + //if the content-picker is being rendered inside the document-type editor, we don't need to process the startnode query + dialogOptions.startNodeId = -1; + } else if ($scope.model.config.startNode.query) { + //if we have a query for the startnode, we will use that. var rootId = $routeParams.id; entityResource.getByQuery($scope.model.config.startNode.query, rootId, "Document").then(function (ent) { dialogOptions.startNodeId = ent.id;