If this request requires additional support (e.g., such as direct email/phone/meeting/development), I have the following interest in helping to sponsor the effot via GitHub Sponsors:
[ ] None, please continute to work for me for free :P
[ ] Absolutely, I get value out of this!
[ ] Maybe later
[x] I'm already a sponsor... Woot!
Describe the bug
When creating a new role, I get an exception.
Software Versions
DNN: 09.10.02
Module: 01.00.00
To Reproduce
Steps to reproduce the behavior:
Clean install of both.
Add the module to any page.
Click the Roles List button.
Click the Create Role button.
Add any role name. I used a real-world example of Press Team.
Leave all other fields unchanged.
Click the Save button to add the role.
Expected behavior
The role is added.
Actual behavior
A fatal and untrapped exception occurred.
Screenshots
N/A
Error log
Error: is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Roles_RoleGroups". The conflict occurred in database "Dev_UserManager", table "dbo.RoleGroups", column 'RoleGroupID'. The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at PetaPoco.Database.ExecuteScalarInternal[T](CommandType commandType, String sql, Object[] args)
at DotNetNuke.Data.PetaPoco.PetaPocoHelper.ExecuteScalar[T](String connectionString, CommandType type, Int32 timeoutSec, String sql, Object[] args)
at DotNetNuke.Data.SqlDataProvider.ExecuteScalar[T](String procedureName, Object[] commandParameters)
at DotNetNuke.Security.Roles.DNNRoleProvider.CreateRole(RoleInfo role) ClientConnectionId:ce584174-466c-4d25-94cb-ef6652023447 Error Number:547,State:0,Class:16
--->
System.ArgumentException: System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Roles_RoleGroups". The conflict occurred in database "Dev_UserManager", table "dbo.RoleGroups", column 'RoleGroupID'. The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at PetaPoco.Database.ExecuteScalarInternal[T](CommandType commandType, String sql, Object[] args)
at DotNetNuke.Data.PetaPoco.PetaPocoHelper.ExecuteScalar[T](String connectionString, CommandType type, Int32 timeoutSec, String sql, Object[] args)
at DotNetNuke.Data.SqlDataProvider.ExecuteScalar[T](String procedureName, Object[] commandParameters)
at DotNetNuke.Security.Roles.DNNRoleProvider.CreateRole(RoleInfo role) ClientConnectionId:ce584174-466c-4d25-94cb-ef6652023447 Error Number:547,State:0,Class:16
at DotNetNuke.Security.Roles.DNNRoleProvider.CreateRole(RoleInfo role)
at DotNetNuke.Security.Roles.RoleController.DotNetNuke.Security.Roles.IRoleController.AddRole(RoleInfo role, Boolean addToExistUsers)
at Upendo.Modules.UserManager.Utility.RolesRepository.CreateRol(RolesViewModel rol) in C:\Work\Dnn.Modules\UpendoUserManager\Upendo-Dnn-UserManager\Modules\UserManager\Utility\RolesRepository.cs:line 110
at Upendo.Modules.UserManager.Controllers.RolesManageController.Create(RolesViewModel item) in C:\Work\Dnn.Modules\UpendoUserManager\Upendo-Dnn-UserManager\Modules\UserManager\Controllers\RolesManageController.cs:line 71
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at DotNetNuke.Web.Mvc.Framework.Modules.ResultCapturingActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
at System.Web.Mvc.Controller.ExecuteCore()
at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
at DotNetNuke.Web.Mvc.Framework.Modules.ModuleApplication.ExecuteRequest(ModuleRequestContext context)
at DotNetNuke.Web.Mvc.MvcHostControl.ExecuteModule()
--- End of inner exception stack trace ---
Sponsorship
If this request requires additional support (e.g., such as direct email/phone/meeting/development), I have the following interest in helping to sponsor the effot via GitHub Sponsors:
Describe the bug
When creating a new role, I get an exception.
Software Versions
To Reproduce
Steps to reproduce the behavior:
Roles List
button.Create Role
button.Press Team
.Expected behavior
The role is added.
Actual behavior
A fatal and untrapped exception occurred.
Screenshots
N/A
Error log
Additional context
N/A