B2018-048 Opening an item from search results would sometimes be caught in an infinite loop. The code was trying to use the dictionary for open PROMS windows even when the Separate Windows mode was not active.

This commit is contained in:
John Jenko 2018-03-15 14:16:15 +00:00
parent c10da98204
commit daf19ec057

View File

@ -541,6 +541,11 @@ namespace Volian.Controls.Library
return null;
}
string message = string.Empty;
//if (!MySessionInfo.CanCheckOutItem(myItemInfo.MyDocVersion.VersionID, CheckOutType.DocVersion, ref message))
//{
// message = "The Working Draft is being processed.\n\n" + message;
// MessageBox.Show(this, message, "Cannot Check Out Procedure", MessageBoxButtons.OK, MessageBoxIcon.Warning);
//}
if (myItemInfo.MyContent.MyEntry == null) //not a document
{
if (!MySessionInfo.CanCheckOutItem(myItemInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message))
@ -576,9 +581,14 @@ namespace Volian.Controls.Library
// then create a new child window. All other procedures from that same set will open in this child window.
// _AllDTCs is a dictionary of of all procedure sets opened along with their DisplayTabContol. The key to
// the dictioan is the set's VersionID
if (VersionID != 0)
// B2018-048 needed to add a check to see if we are in Separate Windows
// else we get stuck in a OpenItem loop when last DocVersion ID is not equal to the current DocVersion ID
// happened when you open a procedure then close the procedure tab, do a text search in a different procedure set
// then select one of search results.
if (SeparateWindows && VersionID != 0)
{
if (SeparateWindows && !libDocAlreadyOpen)
if (!libDocAlreadyOpen)
{
if (!_AllDTCs.ContainsKey(myItemInfo.MyDocVersion.VersionID))
{