From 15c36a63d3a62c8d15a8716e38b79986d5caf6ce Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 13 Feb 2015 12:35:57 +1100 Subject: [PATCH] Fixes: U4-6168 Custom Section is not showing correctly in 7.2 if custom tree is empty --- .../src/controllers/navigation.controller.js | 2 +- src/Umbraco.Web/Models/Trees/SectionRootNode.cs | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/controllers/navigation.controller.js b/src/Umbraco.Web.UI.Client/src/controllers/navigation.controller.js index 1c586e6fd2..80efaa8272 100644 --- a/src/Umbraco.Web.UI.Client/src/controllers/navigation.controller.js +++ b/src/Umbraco.Web.UI.Client/src/controllers/navigation.controller.js @@ -76,7 +76,7 @@ function NavigationController($scope, $rootScope, $location, $log, $routeParams, //Listen for section state changes eventsService.on("appState.treeState.changed", function (e, args) { var f = args; - if(args.value.root && args.value.root.children.length === 0){ + if (args.value.root && args.value.root.metaData.containsTrees === false) { $rootScope.emptySection = true; }else{ $rootScope.emptySection = false; diff --git a/src/Umbraco.Web/Models/Trees/SectionRootNode.cs b/src/Umbraco.Web/Models/Trees/SectionRootNode.cs index 3116159f5f..b89a632368 100644 --- a/src/Umbraco.Web/Models/Trees/SectionRootNode.cs +++ b/src/Umbraco.Web/Models/Trees/SectionRootNode.cs @@ -1,4 +1,5 @@ -using System.Runtime.Serialization; +using System.Linq; +using System.Runtime.Serialization; using Umbraco.Core; namespace Umbraco.Web.Models.Trees @@ -17,11 +18,16 @@ namespace Umbraco.Web.Models.Trees { public static SectionRootNode CreateMultiTreeSectionRoot(string nodeId, TreeNodeCollection children) { - return new SectionRootNode(nodeId, "", "") + var sectionRoot = new SectionRootNode(nodeId, "", "") { IsContainer = true, Children = children }; + + //some metadata as to whether or not this section contains any trees + sectionRoot.AdditionalData["containsTrees"] = children.Any(); + + return sectionRoot; } public static SectionRootNode CreateSingleTreeSectionRoot(string nodeId, string getChildNodesUrl, string menuUrl, string title, TreeNodeCollection children)