|
|
Rank: Advanced Member
Joined: 4/17/2008 Posts: 36
|
There's a user that i cannot delete. Here is the event log. Can someone help? Quote: 7/23/2008 10:43 AM in .Net SqlClient Data Provider The DELETE statement conflicted with the REFERENCE constraint "FK_yaf_UserPMessage_yaf_PMessage". The conflict occurred in database "hcforum", table "dbo.yaf_UserPMessage", column 'PMessageID'. The DELETE statement conflicted with the REFERENCE constraint "FK_yaf_PMessage_yaf_User1". The conflict occurred in database "forum", table "dbo.yaf_PMessage", column 'FromUserID'. The statement has been terminated. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) 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) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at yaf.DB.ExecuteNonQuery(SqlCommand cmd) at yaf.DB.user_delete(Object UserID) at yaf.pages.admin.users.UserList_ItemCommand(Object source, RepeaterCommandEventArgs e) at System.Web.UI.WebControls.Repeater.OnItemCommand(RepeaterCommandEventArgs e) at System.Web.UI.WebControls.Repeater.OnBubbleEvent(Object sender, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.RepeaterItem.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
|
|
|
Rank: Advanced Member
Joined: 4/17/2008 Posts: 36
|
Anyone can help me with this? I cannot debug this.
|
|
|
Rank: Advanced Member
Joined: 4/17/2008 Posts: 36
|
This is the error in VIsual studio project . Quote: The DELETE statement conflicted with the REFERENCE constraint "FK_yaf_UserPMessage_yaf_PMessage". The conflict occurred in database "yafforum", table "dbo.yaf_UserPMessage", column 'PMessageID'. The DELETE statement conflicted with the REFERENCE constraint "FK_yaf_PMessage_yaf_User1". The conflict occurred in database "yafforum", table "dbo.yaf_PMessage", column 'FromUserID'. The statement has been terminated. The statement has been terminated.
|
|
|
Rank: Advanced Member
Joined: 4/17/2008 Posts: 36
|
I found out that the user that I am trying to delete send a pm to other user, and the other user has not delete that user's pm, causing the conflict when I am trying to delete. Is there a way to resolve this? I tried with 1.9.8, the issue is still there.
|
|
|
Rank: Advanced Member
Joined: 4/17/2008 Posts: 36
|
Does YAF developer know about this bug? and how to fix it?
|
|
|
 Rank: YAF Head Dude

Joined: 10/10/2004 Posts: 2,950 Location: Honolulu, HI
|
It's a bug... Fixed in newer versions of YAF. "When you are grateful, fear disappears and abundance appears”." 
|
|
|
Rank: Advanced Member
Joined: 4/17/2008 Posts: 36
|
Jaben, if I implement ON DELETE CASCADE, would that be a good idea or bad ?
Also, what happens if I remove the FK out?
|
|
|
 Rank: YAF Head Dude

Joined: 10/10/2004 Posts: 2,950 Location: Honolulu, HI
|
That would be a good idea -- as it would fix your problem right now. "When you are grateful, fear disappears and abundance appears”." 
|
|
|
Rank: Advanced Member
Joined: 4/17/2008 Posts: 36
|
Jaben, one more question if I want to put that, where is the SQL statement that I can put that on delete cascade?
|
|
|
 Rank: YAF Head Dude

Joined: 10/10/2004 Posts: 2,950 Location: Honolulu, HI
|
yaf_user_delete SPROC "When you are grateful, fear disappears and abundance appears”." 
|
|
|
Rank: Advanced Member
Joined: 4/17/2008 Posts: 36
|
Jaben, if I implement that, the PM message gets deleted too, no? Even though the other user has not read the message yet.
|
|
|
 Rank: YAF Head Dude

Joined: 10/10/2004 Posts: 2,950 Location: Honolulu, HI
|
Yes. This is why it's not a simplistic fix and was only really fixed in newer versions. "When you are grateful, fear disappears and abundance appears”." 
|
|
|
| Users browsing this topic |
|
Guest
|