diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 516874d4e..529f875a1 100644 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -3363,12 +3363,13 @@ class Cases //if the user is not in the task, we need to return a valid del index, so we are returning the latest delindex $oCriteria = new Criteria(); $oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID); + $oCriteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN'); $oCriteria->addDescendingOrderByColumn(AppDelegationPeer::DEL_DELEGATE_DATE); $oApplication = AppDelegationPeer::doSelectOne($oCriteria); if (!is_null($oApplication)) { return $oApplication->getDelIndex(); } - throw ( new Exception('this case has 0 delegations') ); + throw ( new Exception('This case has 0 current delegations') ); } /* diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php index e21c32d6e..a18404603 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php @@ -1017,7 +1017,7 @@ class Light { $response = array("status" => "fail"); $oCase = new \Cases(); - $iDelIndex = $oCase->getCurrentDelegation( $sAppUid, $userUid ); + $iDelIndex = $oCase->getCurrentDelegation( $sAppUid, '' ); $oAppDelegation = new \AppDelegation(); $aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );