B2017-069 – remove enhanced document information from the config when a step is restored from history

Added a null check
This commit is contained in:
2017-03-31 15:18:02 +00:00
parent 8f81199574
commit de0e7d3613
2 changed files with 19 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ using Csla.Validation;
using System.Data.SqlClient;
using System.Data;
using System.Text.RegularExpressions;
using System.Xml;
namespace VEPROMS.CSLA.Library
{
@@ -1629,6 +1630,22 @@ namespace VEPROMS.CSLA.Library
ContentInfo.Refresh(cctmp);
}
}
// B2017-069 when we restore a step the once had enhanced document links,
// remove the enhanced document link information - fixes delete/restore issue of linked steps.
XmlDocument xd = new XmlDocument();
xd.LoadXml(tmp.MyContent.Config);
XmlNode xn = xd.DocumentElement.SelectSingleNode("Enhanced");
if (xn != null)
{
xn.ParentNode.RemoveChild(xn);
string config = xd.OuterXml;
using (Content ctmp = tmp.MyContent.Get())
{
ctmp.Config = config;
ctmp.Save();
ContentInfo.Refresh(ctmp);
}
}
return tmp;
}
catch (Exception ex)