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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user