Merge pull request 'B2024-059: Paste source section has bad links.' (#391) from B2024-059 into Development

Reviewed-on: #391
Reviewed-by: Paul Larsen <plarsen@volian.com>
This commit is contained in:
Paul Larsen 2024-08-15 10:10:13 -04:00
commit 7713f0cd63

View File

@ -951,7 +951,10 @@ namespace VEPROMS.CSLA.Library
// it is pasted into a section without enhanced data, then clear it. // it is pasted into a section without enhanced data, then clear it.
// config data can only be on hls/notes/cautions for pasted steps. // 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 // 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. // 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. // of the pasted step.
if (pasteItem.HasEnhancedLinkedStep) pasteItem.RemoveEnhancedFromConfig(); 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 #endregion
#region Insert Child #region Insert Child