From c4e8e20f02748d027909e6d521cf22b095fa4125 Mon Sep 17 00:00:00 2001 From: Claus Date: Sun, 24 Jan 2016 15:36:29 +0100 Subject: [PATCH] Reverted to only update exactly what is needed for this to work. Switched away from ugly xpath - using linq. --- .../Services/ApplicationTreeService.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/Umbraco.Core/Services/ApplicationTreeService.cs b/src/Umbraco.Core/Services/ApplicationTreeService.cs index 01e2883435..a3ab673e86 100644 --- a/src/Umbraco.Core/Services/ApplicationTreeService.cs +++ b/src/Umbraco.Core/Services/ApplicationTreeService.cs @@ -98,18 +98,14 @@ namespace Umbraco.Core.Services var count = 0; foreach (var tree in unregistered) { - //ugly translate hack to allow case insensitive matching since 'matches' is a xpath2.0 feature... - var existingElement = doc.Root.XPathSelectElement("//add[translate(@alias,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')=translate('" + tree.Alias + "','abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')]"); + var existingElement = doc.Root.Elements("add").SingleOrDefault(x => + string.Equals(x.Attribute("alias").Value, tree.Alias, + StringComparison.InvariantCultureIgnoreCase) && + string.Equals(x.Attribute("application").Value, tree.ApplicationAlias, + StringComparison.InvariantCultureIgnoreCase)); if (existingElement != null) { - existingElement.SetAttributeValue("initialize", tree.Initialize); - existingElement.SetAttributeValue("sortOrder", tree.Initialize); existingElement.SetAttributeValue("alias", tree.Alias); - existingElement.SetAttributeValue("application", tree.ApplicationAlias); - existingElement.SetAttributeValue("title", tree.Title); - existingElement.SetAttributeValue("iconClosed", tree.IconClosed); - existingElement.SetAttributeValue("iconOpen", tree.IconOpened); - existingElement.SetAttributeValue("type", tree.Type); } else { @@ -141,11 +137,7 @@ namespace Umbraco.Core.Services } } } - - return list; - - }, new TimeSpan(0, 10, 0)); }