Quick fix for note saving problem from Roy

This commit is contained in:
Dan Stillman 2006-10-06 00:12:47 +00:00
parent 7712a24434
commit ba5b978afb

View File

@ -907,12 +907,24 @@ Zotero.Item.prototype.updateNote = function(text){
Zotero.DB.beginTransaction();
if (this.isNote()){
var sql = "UPDATE itemNotes SET note=? WHERE itemID=?";
var sourceID = this.getSource();
if (sourceID)
{
var sql = "REPLACE INTO itemNotes (note, sourceItemID, itemID) "
+ "VALUES (?,?,?)";
var bindParams = [{string:text}, sourceID, this.getID()];
}
else
{
var sql = "REPLACE INTO itemNotes (note, itemID) VALUES (?,?)";
var bindParams = [{string:text}, this.getID()];
}
}
else {
var sql = "REPLACE INTO itemNotes (note, itemID) VALUES (?,?)";
var bindParams = [{string:text}, this.getID()];
}
var bindParams = [{string:text}, this.getID()];
var updated = Zotero.DB.query(sql, bindParams);
if (updated){
this.updateDateModified();