From febe81105bcff7305dfa6b38eabae5fecf9e4088 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 15 Nov 2013 18:26:40 +1100 Subject: [PATCH] starts fixing custom membership provider problems with the member editor/tree - this now at least loads in the members section. --- src/Umbraco.Web/Trees/ApplicationTreeController.cs | 8 ++++++-- src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Trees/ApplicationTreeController.cs b/src/Umbraco.Web/Trees/ApplicationTreeController.cs index b16ee8bd00..5b18e5698b 100644 --- a/src/Umbraco.Web/Trees/ApplicationTreeController.cs +++ b/src/Umbraco.Web/Trees/ApplicationTreeController.cs @@ -75,8 +75,12 @@ namespace Umbraco.Web.Trees foreach (var apptree in appTrees) { //return the root nodes for each tree in the app - var rootNode = GetRootForMultipleAppTree(apptree, queryStrings); - collection.Add(rootNode); + var rootNode = GetRootForMultipleAppTree(apptree, queryStrings); + //This could be null if the tree decides not to return it's root (i.e. the member type tree does this when not in umbraco membership mode) + if (rootNode != null) + { + collection.Add(rootNode); + } } var multiTree = SectionRootNode.CreateMultiTreeSectionRoot(rootId, collection); diff --git a/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs b/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs index f39c79fe8b..72c58f7e4d 100644 --- a/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs +++ b/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs @@ -82,6 +82,12 @@ namespace Umbraco.Web.Trees return Attempt.Fail(xmlTreeNodeAttempt.Exception); } + //the root can potentially be null, in that case we'll just return a null success which means it won't be included + if (xmlTreeNodeAttempt.Result == null) + { + return Attempt.Succeed(null); + } + var legacyController = new LegacyTreeController(xmlTreeNodeAttempt.Result, appTree.Alias, currentSection, urlHelper); var newRoot = legacyController.GetRootNode(formCollection);