Skip to content

Commit

Permalink
+ (Group) Fixed bulk update not adding people to groups. (Fixes #5526)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleDavidVilla committed Aug 4, 2023
1 parent 7939635 commit 3373762
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions RockWeb/Blocks/Crm/BulkUpdate.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2336,9 +2336,14 @@ private void ProcessIndividuals( List<int> personIdList )
{
var newGroupMembers = new List<GroupMember>();

var existingIds = existingMembersQuery.Select( m => m.PersonId ).Distinct().ToList();
var existingMembers = existingMembersQuery
.Select( m => new
{
m.PersonId,
m.GroupRoleId
} ).ToList();

var personKeys = ids.Where( id => !existingIds.Contains( id ) ).ToList();
var personKeys = ids.Where( id => !existingMembers.Any( m => m.PersonId == id && m.GroupRoleId == UpdateGroupRoleId.Value ) ).ToList();

Action<RockContext, List<int>> addAction = ( context, items ) =>
{
Expand Down

0 comments on commit 3373762

Please sign in to comment.