Incorrect syntax near ')' when using the framework UserGroupManager Get List

  • Updated

You may experience an issue when using the framework UserGroupManager GetList to retrieve a list of user groups under the following circumstances:

  • Converting a 3-tier environment to a 2-tier
  • Using a 3rd party authentication program, such as OAuth
  • Using MVC

The problem is that the SQL query is not constructing the CMS group or Membership Group information. For example:

Normal SQL query

Select count(*) FROM UserGroupList  WHERE ((membership_group = @p0
)
)

SQL query when error occurs

Select count(*) FROM UserGroupList  WHERE ((
)
)

The error is thrown because the group data is missing from the Where statement.

The workaround is to use the legacy User API to return the group information:

var usergroup = new Ektron.Cms.API.User.User();
Ektron.Cms.UserGroupData[] data = usergroup.GetAllUserGroups(Ektron.Cms.Common.EkEnumeration.UserTypes.MemberShipType, string.Empty);

UserTypes

AuthorType 
MemberShipType 
BothGroupTypes