You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Groups/Invoke-AddGroupTemplate.ps1
+13-6Lines changed: 13 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -14,35 +14,42 @@ function Invoke-AddGroupTemplate {
14
14
throw'You must enter a displayname'
15
15
}
16
16
17
-
# Normalize group type to match New-CIPPGroup expectations (handle both camelCase and lowercase)
17
+
# Normalize group type to match New-CIPPGroup expectations
18
+
# Handle values from ListGroups calculatedGroupType and frontend form values
# Override to dynamic if membership rules are provided (for backward compatibility)
33
39
# but only if it's not already a dynamicDistribution group
34
-
if ($Request.body.membershipRules-and$groupType-notin@('dynamicDistribution')) {
40
+
if ($Request.body.membershipRules-and![string]::IsNullOrEmpty($Request.Body.membershipRules) -and$Request.Body.membershipRules-ne'membershipRule'-and$groupType-notin@('dynamicDistribution')) {
35
41
$groupType='dynamic'
36
42
}
37
43
# Normalize field names to handle different casing from various forms
Copy file name to clipboardExpand all lines: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Groups/Invoke-ListGroupTemplates.ps1
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,12 @@ function Invoke-ListGroupTemplates {
16
16
$data=$_.JSON|ConvertFrom-Json
17
17
18
18
# Normalize groupType to camelCase for consistent frontend handling
19
+
# Handle both stored normalized values and legacy values
0 commit comments