SparkDevNetwork / Rock

An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
http://www.rockrms.com
572 stars 347 forks source link

Duplicate Person Record In Check-in #558

Closed BelAirIT closed 9 years ago

BelAirIT commented 9 years ago

When looking up a record during check-in two entries show up. One is the entire family (mine) and the second is just the father's record (me). Looking in the database shows no duplicate records.

azturner commented 9 years ago

Can you confirm that Jeremy does not belong to two families. For example in the screenshot below, Ted is actually part of two families and same thing would happen for him when checking in... image

BelAirIT commented 9 years ago

Surprisingly, he is in two families. Since I can't delete a family (he's the only one in the second family) I added a new record, changed the second family last name and clicked "Move to New Family" for Jeremy. While he was removed from the new family it put him right back into a second Turgeon family.

azturner commented 9 years ago

Easiest way around that, is to edit the main family ( the one with wife/kids ) and move him to a new family and save (he'll then be in two families on his own, and not in the family with wife/kids). Then edit that family again and add his existing record back to the family and select option to remove from existing families.

azturner commented 9 years ago

Closing this issue and opened new issue about not being able to delete family: https://github.com/SparkDevNetwork/Rock/issues/581

BelAirIT commented 9 years ago

When attempting to remove Jeremy to a new family and then re-attach him I get this error: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

An exception has occurred. Details of this error can be found below: An error occurred on the Rock RMS site on page: http://rock:80/EditFamily/3/41 HttpUnhandledException in System.Web Message Exception of type 'System.Web.HttpUnhandledException' was thrown. Stack Trace at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -DbUpdateException in Rock Message An error occurred while updating the entries. See the inner exception for details. Stack Trace at Rock.Data.DbContext.WrapTransaction(Action action) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --UpdateException in EntityFramework Message An error occurred while updating the entries. See the inner exception for details. Stack Trace at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update() at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction) at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func1 operation) at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction) at System.Data.Entity.Internal.InternalContext.SaveChanges() ---SqlException in .Net SqlClient Data Provider Message Cannot insert duplicate key row in object 'dbo.PersonAlias' with unique index 'IX_AliasPersonId'. The duplicate key value is (2). The statement has been terminated. Stack Trace at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 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) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Entity.Infrastructure.Interception.InternalDispatcher1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func3 operation, TInterceptionContext interceptionContext, Action3 executing, Action3 executed) at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext) at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary2 identifierValues, List1 generatedValues) at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()

azturner commented 9 years ago

Sorry, yeah, I forgot I got the same error, but then fixed it for next update ( coming soon ).