B2024-078 Bad Transition preventing editing of a substep. Can enter changed text, but then when move to another textbox, original text returns. #427

Merged
jjenko merged 1 commits from B2024-078 into Development 2024-10-10 08:57:54 -04:00

View File

@ -1165,7 +1165,10 @@ namespace VEPROMS.CSLA.Library
{ {
int sp = odte.Link.IndexOf(" ") + 1; // get past tran type int sp = odte.Link.IndexOf(" ") + 1; // get past tran type
string srecid = odte.Link.Substring(sp, odte.Link.IndexOf(" ", sp) - sp); string srecid = odte.Link.Substring(sp, odte.Link.IndexOf(" ", sp) - sp);
recid = System.Convert.ToInt32(srecid);
//CSM B2024-078 - when a bad transition link / does not contain a number, simply return the text as-is
if (int.TryParse(srecid, out recid))
{
foreach (ContentTransition ct in itm.MyContent.ContentTransitions) foreach (ContentTransition ct in itm.MyContent.ContentTransitions)
{ {
if (ct.TransitionID == recid) if (ct.TransitionID == recid)
@ -1175,6 +1178,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
}
else else
{ {
int sp = odte.Link.IndexOf(" "); int sp = odte.Link.IndexOf(" ");
@ -1656,7 +1660,15 @@ namespace VEPROMS.CSLA.Library
private string FixTransition(string link, string text) private string FixTransition(string link, string text)
{ {
if (link.IndexOf("<NewID>") != -1) return text; if (link.IndexOf("<NewID>") != -1) return text;
int transitionID = Convert.ToInt32(link.Split(" ".ToCharArray())[1]);
//CSM B2024-078 - when a bad transition link / does not contain a number, simply return the text as-is
int transitionID;
string[] splt_link = link.Split(' ');
if (splt_link.Length < 2 || !int.TryParse(splt_link[1], out transitionID))
{
return text;
}
// Find the transition // Find the transition
if (_MyItemInfo.MyContent.ContentTransitionCount <= 0) if (_MyItemInfo.MyContent.ContentTransitionCount <= 0)
{ {