Fixed U4-703 - Updating or re-installing package causes duplicate trees

This commit is contained in:
Sebastiaan Janssen
2012-12-19 09:05:23 -01:00
parent 735bd574ff
commit 47d1fe7082

View File

@@ -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);
}