Skip to content

Commit

Permalink
+ (Group) Fixed issue from Group Member Detail block where starting a…
Browse files Browse the repository at this point in the history
… Group Requirement with a non-persisted workflow type causes an error. (Fixes #5347)
  • Loading branch information
croske committed Mar 23, 2023
1 parent ec69bed commit 44f2f84
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Rock/Web/UI/Controls/GroupMemberRequirementCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,14 @@ protected void lbDoesNotMeetWorkflow_Click( object sender, EventArgs e )

// Begin the workflow.
var workflowType = WorkflowTypeCache.Get( this._groupMemberRequirementType.DoesNotMeetWorkflowTypeId.Value );

// If a workflow type is not persisted, let the user know that it did not work.
if ( !workflowType.IsPersisted )
{
_modalAlert.Show( $"The Workflow Type '{workflowType.Name}' is not configured to be automatically persisted, and could not be started.", ModalAlertType.Warning );
return;
}

if ( workflowType != null && ( workflowType.IsActive ?? true ) )
{
var rockContext = new RockContext();
Expand Down Expand Up @@ -709,6 +717,14 @@ protected void lbWarningWorkflow_Click( object sender, EventArgs e )

// Begin the workflow.
var workflowType = WorkflowTypeCache.Get( this._groupMemberRequirementType.WarningWorkflowTypeId.Value );

// If a workflow type is not persisted, let the user know that it did not work.
if ( !workflowType.IsPersisted )
{
_modalAlert.Show( $"The Workflow Type '{workflowType.Name}' is not configured to be automatically persisted, and could not be started.", ModalAlertType.Warning );
return;
}

if ( workflowType != null && ( workflowType.IsActive ?? true ) )
{
var rockContext = new RockContext();
Expand Down

0 comments on commit 44f2f84

Please sign in to comment.