From 47d1fe70822c3b4ec83dd6a82bf8181fbdd9f631 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 19 Dec 2012 09:05:23 -0100 Subject: [PATCH] Fixed U4-703 - Updating or re-installing package causes duplicate trees --- src/umbraco.businesslogic/ApplicationTree.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/umbraco.businesslogic/ApplicationTree.cs b/src/umbraco.businesslogic/ApplicationTree.cs index d5a4ff4ffa..67faf9b7ec 100644 --- a/src/umbraco.businesslogic/ApplicationTree.cs +++ b/src/umbraco.businesslogic/ApplicationTree.cs @@ -260,6 +260,10 @@ namespace umbraco.BusinessLogic LoadXml(doc => { + var el = doc.Root.Elements("add").SingleOrDefault(x => x.Attribute("alias").Value == alias && x.Attribute("application").Value == applicationAlias); + + if (el == null) + { doc.Root.Add(new XElement("add", new XAttribute("silent", silent), new XAttribute("initialize", initialize), @@ -272,6 +276,7 @@ namespace umbraco.BusinessLogic new XAttribute("assembly", assemblyName), new XAttribute("type", type), new XAttribute("action", string.IsNullOrEmpty(action) ? "" : action))); + } }, true); }