Disallow setting note source to another note (presumably that's what See Also is for)

This commit is contained in:
Dan Stillman 2006-06-28 18:28:09 +00:00
parent cef196529c
commit e22bdaab33

View File

@ -1231,6 +1231,10 @@ Scholar.Notes = new function(){
Scholar.DB.commitTransaction(); Scholar.DB.commitTransaction();
throw ("Cannot set note source to invalid item " + sourceItemID); throw ("Cannot set note source to invalid item " + sourceItemID);
} }
if (sourceItem.isNote()){
Scholar.DB.commitTransaction();
throw ("Cannot set note source to another note (" + sourceItemID + ")");
}
} }
var note = Scholar.Items.getNewItemByType(Scholar.ItemTypes.getID('note')); var note = Scholar.Items.getNewItemByType(Scholar.ItemTypes.getID('note'));