From 37e2ca90ccba48dc435d3d6f7071cf91d5854e88 Mon Sep 17 00:00:00 2001 From: Melanie Spence <45180558+melzs0627@users.noreply.github.com> Date: Thu, 6 Apr 2023 09:07:16 -0700 Subject: [PATCH] + (Core) Fixed Group List Block Root Group not being set. (Fixes #5331) --- RockWeb/Blocks/Groups/GroupList.ascx.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RockWeb/Blocks/Groups/GroupList.ascx.cs b/RockWeb/Blocks/Groups/GroupList.ascx.cs index bb40eacb266..078e80afae2 100644 --- a/RockWeb/Blocks/Groups/GroupList.ascx.cs +++ b/RockWeb/Blocks/Groups/GroupList.ascx.cs @@ -778,6 +778,16 @@ private void BindGrid() var qryGroups = groupService.Queryable() .Where( g => groupTypeIds.Contains( g.GroupTypeId ) && ( !onlySecurityGroups || g.IsSecurityRole ) ); + var rootGroupGuid = GetAttributeValue( AttributeKey.RootGroup ).AsGuidOrNull(); + if ( rootGroupGuid.HasValue ) + { + var parentGroup = groupService.Get( rootGroupGuid.Value ); + if ( parentGroup != null ) + { + qryGroups = qryGroups.Where( g => g.ParentGroupId == parentGroup.Id ); + } + } + string limitToActiveStatus = GetAttributeValue( "LimittoActiveStatus" ); bool showActive = true;