@@ -252,18 +252,22 @@ private void GetControl(string view, string options)
252
252
if ( string . IsNullOrEmpty ( this . ForumIds ) )
253
253
{
254
254
RoleInfo role = DotNetNuke . Security . Roles . RoleController . Instance . GetRoleById ( portalId : this . PortalId , roleId : this . SocialGroupId ) ;
255
-
256
- // Create new forum
257
- bool isPrivate = false ;
258
- if ( ! role . IsPublic )
255
+ Hashtable htSettings = DotNetNuke . Entities . Modules . ModuleController . Instance . GetModule ( moduleId : this . ModuleId , tabId : this . TabId , ignoreCache : false ) . TabModuleSettings ;
256
+ if ( htSettings == null || htSettings . Count == 0 )
259
257
{
260
- isPrivate = true ;
258
+ htSettings = DotNetNuke . Entities . Modules . ModuleController . Instance . GetModule ( moduleId : this . ModuleId , tabId : this . TabId , ignoreCache : false ) . ModuleSettings ;
261
259
}
262
260
263
- Hashtable htSettings = DotNetNuke . Entities . Modules . ModuleController . Instance . GetModule ( moduleId : this . ModuleId , tabId : this . TabId , ignoreCache : false ) . TabModuleSettings ;
264
-
265
- DotNetNuke . Modules . ActiveForums . Controllers . ForumController . CreateSocialGroupForum ( this . PortalId , this . ModuleId , this . SocialGroupId , Convert . ToInt32 ( htSettings [ "ForumGroupTemplate" ] . ToString ( ) ) , role . RoleName + " Discussions" , role . Description , isPrivate , htSettings [ "ForumConfig" ] . ToString ( ) ) ;
266
- this . ForumIds = DotNetNuke . Modules . ActiveForums . Controllers . ForumController . GetForumIdsBySocialGroup ( this . PortalId , this . ForumModuleId , this . SocialGroupId ) ;
261
+ if ( htSettings == null || htSettings . Count == 0 || ! htSettings . ContainsKey ( "ForumGroupTemplate" ) )
262
+ {
263
+ var ex = new Exception ( $ "Unable to configure forum for Social Group: { this . SocialGroupId } ") ;
264
+ DotNetNuke . Services . Exceptions . Exceptions . ProcessModuleLoadException ( this , ex ) ;
265
+ }
266
+ else
267
+ {
268
+ DotNetNuke . Modules . ActiveForums . Controllers . ForumController . CreateSocialGroupForum ( this . PortalId , this . ModuleId , this . SocialGroupId , Convert . ToInt32 ( htSettings [ "ForumGroupTemplate" ] . ToString ( ) ) , role . RoleName + " Discussions" , role . Description , ! role . IsPublic , htSettings [ "ForumConfig" ] . ToString ( ) ) ;
269
+ this . ForumIds = DotNetNuke . Modules . ActiveForums . Controllers . ForumController . GetForumIdsBySocialGroup ( this . PortalId , this . ForumModuleId , this . SocialGroupId ) ;
270
+ }
267
271
}
268
272
}
269
273
0 commit comments