From 2711520666395604458938b108f972a1c68f2a23 Mon Sep 17 00:00:00 2001 From: Kathy Ruffing Date: Thu, 15 Aug 2024 06:51:02 -0400 Subject: [PATCH] B2024-059: Paste source section has bad links. --- PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index bfe64dc4..555dd6d3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -951,7 +951,10 @@ namespace VEPROMS.CSLA.Library // it is pasted into a section without enhanced data, then clear it. // config data can only be on hls/notes/cautions for pasted steps. - if (!pasteItem.IsHigh && !pasteItem.IsCaution && !pasteItem.IsNote) return; + // B2024-059: clear links on a source section. When a paste occurs, the section is copied with the links but not + // new section is created in the enhanced document, so the links point to the original section (copied). These + // need to be removed. + if (!pasteItem.IsHigh && !pasteItem.IsCaution && !pasteItem.IsNote && !pasteItem.IsSection) return; // See if the pasted step's section is enhanced with enhanced steps, and if not, clear it // Also, if pasting into a source section, don't clear (B2017-225), the 'isSourceSection' portion of the code. @@ -974,6 +977,12 @@ namespace VEPROMS.CSLA.Library // of the pasted step. if (pasteItem.HasEnhancedLinkedStep) pasteItem.RemoveEnhancedFromConfig(); } + // B2024-059: clear links on a source section + if (isSourceSection) + { + EnhancedDocuments seleds = pasteItem.GetMyEnhancedDocuments(); + foreach (EnhancedDocument ed in seleds) pasteItem.DoUnlinkEnhanced(pasteItem, ed.Type, true); + } } #endregion #region Insert Child -- 2.47.2