diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs index 294984e3..b0d75ba1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs @@ -1632,7 +1632,8 @@ namespace VEPROMS.CSLA.Library } // B2017-069 when we restore a step that once had enhanced document links, // remove the enhanced document link information - fixes delete/restore issue of linked steps. - RemoveEnhancedFromConfig(tmp, false); + // B2017-070 - when retoring a step that once had enhanced links, remove the link info for the notes and cautions as well + tmp.RemoveEnhancedFromConfig(); return tmp; } catch (Exception ex) @@ -1641,42 +1642,6 @@ namespace VEPROMS.CSLA.Library } } - // B2017-070 - when restoring a step that once had enhanced links, remove the link info for the notes and cautions as well - public static void RemoveEnhancedFromConfig(ItemInfo tmp, bool doOneStepOnly) - { - XmlDocument xd = new XmlDocument(); - if (tmp.MyContent.Config == null || tmp.MyContent.Config == "") return; // B2017-164 & B2017-172 check for null or empty config - 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); - tmp._MyConfig = null; // refresh the memory value - } - } - if (doOneStepOnly) return; - if (tmp.IsHigh) - { - if (tmp.Cautions != null) - foreach (ItemInfo chld in tmp.Cautions) - { - RemoveEnhancedFromConfig(chld, false); - } - if (tmp.Notes != null) - foreach (ItemInfo chld in tmp.Notes) - { - RemoveEnhancedFromConfig(chld, false); - } - } - } - - // Criteria to get Item and children [Serializable()] private class RestoreCriteria {