#1 Error due to constraint violation in userpics table

open
nobody
None
5
2007-12-14
2007-12-14
Anonymous
No

My girlfriend had trouble archiving a greatest journal that somehow had 2 userpics with duplicate keywords.

The following patch adds a check to make certain that a userpic with non-unique keyword will not be added to the archive (thus breaking the constraint and causing a crash).

The patch is made in the Journal.cs file in the Engine.
Lines 1706-1808 (or thereabouts)

public UserPicsRow AddUserPicsRow(string PicKeyword, string PicURL) {
if (this.FindByPicKeyword(PicKeyword) == null)
{
UserPicsRow rowUserPicsRow = ((UserPicsRow)(this.NewRow()));
rowUserPicsRow.ItemArray = new object[] {
PicKeyword,
PicURL};
this.Rows.Add(rowUserPicsRow);
return rowUserPicsRow;
}
else
return null;
}

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks